From ef552c12a6604c4b834f80b68c342d7f9668aa4b Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 27 Nov 2024 10:13:19 +0000 Subject: feat: remove `pull` `push` and `fetch` ngit cmds to simplify the api and encourage use of the git remote helper --- src/bin/ngit/sub_commands/fetch.rs | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/bin/ngit/sub_commands/fetch.rs (limited to 'src/bin/ngit/sub_commands/fetch.rs') diff --git a/src/bin/ngit/sub_commands/fetch.rs b/src/bin/ngit/sub_commands/fetch.rs deleted file mode 100644 index dc548fd..0000000 --- a/src/bin/ngit/sub_commands/fetch.rs +++ /dev/null @@ -1,37 +0,0 @@ -use std::collections::HashSet; - -use anyhow::{Context, Result}; -use clap; -use nostr::nips::nip01::Coordinate; - -use crate::{ - cli::Cli, - client::{fetching_with_report, Client, Connect}, - git::{Repo, RepoActions}, - repo_ref::get_repo_coordinates, -}; - -#[derive(clap::Args)] -pub struct SubCommandArgs { - /// address pointer to repo announcement - #[arg(long, action)] - repo: Vec, -} - -pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { - let _ = args; - let git_repo = Repo::discover().context("failed to find a git repository")?; - let client = Client::default(); - let repo_coordinates = if command_args.repo.is_empty() { - get_repo_coordinates(&git_repo, &client).await? - } else { - let mut repo_coordinates = HashSet::new(); - for repo in &command_args.repo { - repo_coordinates.insert(Coordinate::parse(repo.clone())?); - } - repo_coordinates - }; - fetching_with_report(git_repo.get_path()?, &client, &repo_coordinates).await?; - client.disconnect().await?; - Ok(()) -} -- cgit v1.2.3