From 771f944af447c202eba045936a36dee71ab797ac Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 4 Sep 2024 11:32:05 +0100 Subject: refactor: fix imports, etc based on restructure move some functions out of ngit and into lib/mod and lib/git_events remove MockConnect from binaries so it is only used in the library. this was done: * mainly because automocks were not being imported from lib into each binary * but also because the these functions were being tested with MockConnect --- src/bin/ngit/sub_commands/fetch.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (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 index b1e83c5..c69f1c5 100644 --- a/src/bin/ngit/sub_commands/fetch.rs +++ b/src/bin/ngit/sub_commands/fetch.rs @@ -4,13 +4,9 @@ use anyhow::{Context, Result}; use clap; use nostr::nips::nip01::Coordinate; -#[cfg(not(test))] -use crate::client::Client; -#[cfg(test)] -use crate::client::MockConnect; use crate::{ cli::Cli, - client::{fetching_with_report, Connect}, + client::{fetching_with_report, Client, Connect}, git::{Repo, RepoActions}, repo_ref::get_repo_coordinates, }; @@ -25,10 +21,7 @@ pub struct SubCommandArgs { pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { let _ = args; let git_repo = Repo::discover().context("cannot find a git repository")?; - #[cfg(not(test))] let client = Client::default(); - #[cfg(test)] - let client = ::default(); let repo_coordinates = if command_args.repo.is_empty() { get_repo_coordinates(&git_repo, &client).await? } else { -- cgit v1.2.3