upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands/list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ngit/sub_commands/list.rs')
-rw-r--r--src/bin/ngit/sub_commands/list.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs
index fc0883a..80eec21 100644
--- a/src/bin/ngit/sub_commands/list.rs
+++ b/src/bin/ngit/sub_commands/list.rs
@@ -95,7 +95,7 @@ fn run_git_fetch(remote_name: &str) -> Result<()> {
95} 95}
96 96
97#[allow(clippy::too_many_lines)] 97#[allow(clippy::too_many_lines)]
98pub async fn launch(status: String, json: bool, id: Option<String>) -> Result<()> { 98pub async fn launch(status: String, json: bool, id: Option<String>, offline: bool) -> Result<()> {
99 if std::env::var("NGIT_INTERACTIVE_MODE").is_ok() { 99 if std::env::var("NGIT_INTERACTIVE_MODE").is_ok() {
100 return launch_interactive().await; 100 return launch_interactive().await;
101 } 101 }
@@ -113,14 +113,16 @@ pub async fn launch(status: String, json: bool, id: Option<String>) -> Result<()
113 .ok() 113 .ok()
114 .flatten(); 114 .flatten();
115 115
116 if let Some((remote_name, _)) = &nostr_remote { 116 if !offline {
117 if std::env::var("NGITTEST").is_ok() { 117 if let Some((remote_name, _)) = &nostr_remote {
118 fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; 118 if std::env::var("NGITTEST").is_ok() {
119 fetching_with_report(git_repo_path, &client, &repo_coordinates).await?;
120 } else {
121 run_git_fetch(remote_name)?;
122 }
119 } else { 123 } else {
120 run_git_fetch(remote_name)?; 124 fetching_with_report(git_repo_path, &client, &repo_coordinates).await?;
121 } 125 }
122 } else {
123 fetching_with_report(git_repo_path, &client, &repo_coordinates).await?;
124 } 126 }
125 127
126 let repo_ref = get_repo_ref_from_cache(Some(git_repo_path), &repo_coordinates).await?; 128 let repo_ref = get_repo_ref_from_cache(Some(git_repo_path), &repo_coordinates).await?;