upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr/list.rs')
-rw-r--r--src/bin/git_remote_nostr/list.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index bba15aa..07c6f59 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -31,7 +31,6 @@ use crate::{
31pub async fn run_list( 31pub async fn run_list(
32 git_repo: &Repo, 32 git_repo: &Repo,
33 repo_ref: &RepoRef, 33 repo_ref: &RepoRef,
34 decoded_nostr_url: &NostrUrlDecoded,
35 for_push: bool, 34 for_push: bool,
36) -> Result<HashMap<String, HashMap<String, String>>> { 35) -> Result<HashMap<String, HashMap<String, String>>> {
37 let nostr_state = 36 let nostr_state =
@@ -43,7 +42,12 @@ pub async fn run_list(
43 42
44 let term = console::Term::stderr(); 43 let term = console::Term::stderr();
45 44
46 let remote_states = list_from_remotes(&term, git_repo, &repo_ref.git_server, decoded_nostr_url); 45 let remote_states = list_from_remotes(
46 &term,
47 git_repo,
48 &repo_ref.git_server,
49 &repo_ref.to_nostr_git_url(&None),
50 );
47 51
48 let mut state = if let Some(nostr_state) = nostr_state { 52 let mut state = if let Some(nostr_state) = nostr_state {
49 for (name, value) in &nostr_state.state { 53 for (name, value) in &nostr_state.state {
@@ -89,8 +93,7 @@ pub async fn run_list(
89 state.retain(|k, _| !k.starts_with("refs/heads/pr/")); 93 state.retain(|k, _| !k.starts_with("refs/heads/pr/"));
90 94
91 let proposals_state = 95 let proposals_state =
92 get_open_proposals_state(&term, git_repo, repo_ref, decoded_nostr_url, &remote_states) 96 get_open_proposals_state(&term, git_repo, repo_ref, &remote_states).await?;
93 .await?;
94 97
95 state.extend(proposals_state); 98 state.extend(proposals_state);
96 99
@@ -114,7 +117,6 @@ async fn get_open_proposals_state(
114 term: &console::Term, 117 term: &console::Term,
115 git_repo: &Repo, 118 git_repo: &Repo,
116 repo_ref: &RepoRef, 119 repo_ref: &RepoRef,
117 decoded_nostr_url: &NostrUrlDecoded,
118 remote_states: &HashMap<String, HashMap<String, String>>, 120 remote_states: &HashMap<String, HashMap<String, String>>,
119) -> Result<HashMap<String, String>> { 121) -> Result<HashMap<String, String>> {
120 // we cannot use commit_id in the latest patch in a proposal because: 122 // we cannot use commit_id in the latest patch in a proposal because:
@@ -133,7 +135,7 @@ async fn get_open_proposals_state(
133 .cloned() 135 .cloned()
134 .collect::<Vec<String>>(), 136 .collect::<Vec<String>>(),
135 git_server_url, 137 git_server_url,
136 decoded_nostr_url, 138 &repo_ref.to_nostr_git_url(&None),
137 term, 139 term,
138 ) 140 )
139 .is_ok() 141 .is_ok()