From ab1214060a7a2d55068a7ccc9c7f6a04fd7d5aa2 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 19 Jul 2024 20:38:00 +0100 Subject: feat: intergrate `fetch` into `send` reworking the tests and test suite as appropriate --- src/sub_commands/fetch.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/sub_commands/fetch.rs') diff --git a/src/sub_commands/fetch.rs b/src/sub_commands/fetch.rs index 28eb960..ab6e0fc 100644 --- a/src/sub_commands/fetch.rs +++ b/src/sub_commands/fetch.rs @@ -9,7 +9,7 @@ use crate::client::Client; #[cfg(test)] use crate::client::MockConnect; use crate::{ - client::{consolidate_fetch_reports, Connect}, + client::{fetching_with_report, Connect}, git::{Repo, RepoActions}, repo_ref::get_repo_coordinates, Cli, @@ -38,16 +38,7 @@ pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { } repo_coordinates }; - println!("fetching updates..."); - let (relay_reports, _) = client - .fetch_all(git_repo.get_path()?, &repo_coordinates, &HashSet::new()) - .await?; - let report = consolidate_fetch_reports(relay_reports); - if report.to_string().is_empty() { - println!("no updates"); - } else { - println!("updates: {report}"); - } + fetching_with_report(git_repo.get_path()?, &client, &repo_coordinates).await?; client.disconnect().await?; Ok(()) } -- cgit v1.2.3