diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-16 21:34:41 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-16 21:34:41 +0000 |
| commit | 6e4a923574eac2d5e58df1313953caedb3e6a2f2 (patch) | |
| tree | 72212564f16ec804b62d196e1b9f40fe27ccbf9a /src/bin/ngit/sub_commands/list.rs | |
| parent | 9cbf60ea64b0875f525ccd75651aeb3b7605ea02 (diff) | |
test: dont use git fetch during tests
this prevents cli output errors on tests such as:
finds_based_on_naddr_on_embeded_relay_and_added_as_origin_remote
Diffstat (limited to 'src/bin/ngit/sub_commands/list.rs')
| -rw-r--r-- | src/bin/ngit/sub_commands/list.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs index ff43bd9..d2e338d 100644 --- a/src/bin/ngit/sub_commands/list.rs +++ b/src/bin/ngit/sub_commands/list.rs | |||
| @@ -114,7 +114,11 @@ pub async fn launch(status: String, json: bool, id: Option<String>) -> Result<() | |||
| 114 | .flatten(); | 114 | .flatten(); |
| 115 | 115 | ||
| 116 | if let Some((remote_name, _)) = &nostr_remote { | 116 | if let Some((remote_name, _)) = &nostr_remote { |
| 117 | run_git_fetch(remote_name)?; | 117 | if std::env::var("NGITTEST").is_ok() { |
| 118 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; | ||
| 119 | } else { | ||
| 120 | run_git_fetch(remote_name)?; | ||
| 121 | } | ||
| 118 | } else { | 122 | } else { |
| 119 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; | 123 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; |
| 120 | } | 124 | } |
| @@ -364,7 +368,11 @@ async fn launch_interactive() -> Result<()> { | |||
| 364 | .flatten(); | 368 | .flatten(); |
| 365 | 369 | ||
| 366 | if let Some((remote_name, _)) = &nostr_remote { | 370 | if let Some((remote_name, _)) = &nostr_remote { |
| 367 | run_git_fetch(remote_name)?; | 371 | if std::env::var("NGITTEST").is_ok() { |
| 372 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; | ||
| 373 | } else { | ||
| 374 | run_git_fetch(remote_name)?; | ||
| 375 | } | ||
| 368 | } else { | 376 | } else { |
| 369 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; | 377 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; |
| 370 | } | 378 | } |