diff options
Diffstat (limited to 'src/sub_commands/fetch.rs')
| -rw-r--r-- | src/sub_commands/fetch.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sub_commands/fetch.rs b/src/sub_commands/fetch.rs index 07fd6f9..5a6850c 100644 --- a/src/sub_commands/fetch.rs +++ b/src/sub_commands/fetch.rs | |||
| @@ -9,7 +9,7 @@ use crate::client::Client; | |||
| 9 | #[cfg(test)] | 9 | #[cfg(test)] |
| 10 | use crate::client::MockConnect; | 10 | use crate::client::MockConnect; |
| 11 | use crate::{ | 11 | use crate::{ |
| 12 | client::Connect, | 12 | client::{consolidate_fetch_reports, Connect}, |
| 13 | git::{Repo, RepoActions}, | 13 | git::{Repo, RepoActions}, |
| 14 | repo_ref::get_repo_coordinates, | 14 | repo_ref::get_repo_coordinates, |
| 15 | Cli, | 15 | Cli, |
| @@ -38,9 +38,16 @@ pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { | |||
| 38 | } | 38 | } |
| 39 | repo_coordinates | 39 | repo_coordinates |
| 40 | }; | 40 | }; |
| 41 | client | 41 | println!("fetching updates..."); |
| 42 | let (relay_reports, _) = client | ||
| 42 | .fetch_all(git_repo.get_path()?, &repo_coordinates) | 43 | .fetch_all(git_repo.get_path()?, &repo_coordinates) |
| 43 | .await?; | 44 | .await?; |
| 45 | let report = consolidate_fetch_reports(relay_reports); | ||
| 46 | if report.to_string().is_empty() { | ||
| 47 | println!("no updates"); | ||
| 48 | } else { | ||
| 49 | println!("updates: {report}"); | ||
| 50 | } | ||
| 44 | client.disconnect().await?; | 51 | client.disconnect().await?; |
| 45 | Ok(()) | 52 | Ok(()) |
| 46 | } | 53 | } |