upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/git_remote_nostr/fetch.rs14
-rw-r--r--src/bin/git_remote_nostr/list.rs16
2 files changed, 20 insertions, 10 deletions
diff --git a/src/bin/git_remote_nostr/fetch.rs b/src/bin/git_remote_nostr/fetch.rs
index b0d6cfe..7ee264b 100644
--- a/src/bin/git_remote_nostr/fetch.rs
+++ b/src/bin/git_remote_nostr/fetch.rs
@@ -188,10 +188,16 @@ async fn fetch_open_or_draft_proposals_from_patches(
188 } else if let Err(error) = 188 } else if let Err(error) =
189 make_commits_for_proposal(git_repo, repo_ref, events_to_apply) 189 make_commits_for_proposal(git_repo, repo_ref, events_to_apply)
190 { 190 {
191 term.write_line( 191 if let Ok(Some(public_key)) = get_curent_user(git_repo) {
192 format!("WARNING: failed to create branch for {refstr}, error: {error}",) 192 if repo_ref.maintainers.contains(&public_key)
193 .as_str(), 193 || events_to_apply.iter().any(|e| e.pubkey.eq(&public_key))
194 )?; 194 {
195 term.write_line(
196 format!("WARNING (only shown to maintainers or author): failed to create branch for {refstr}, error: {error}",)
197 .as_str(),
198 )?;
199 }
200 }
195 break; 201 break;
196 } 202 }
197 } 203 }
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index af71674..b3ef2f6 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -198,12 +198,16 @@ async fn get_open_and_draft_proposals_state(
198 state.insert(format!("refs/heads/{branch_name}"), tip); 198 state.insert(format!("refs/heads/{branch_name}"), tip);
199 } 199 }
200 Err(error) => { 200 Err(error) => {
201 let _ = term.write_line( 201 if let Ok(Some(public_key)) = get_curent_user(git_repo) {
202 format!( 202 if repo_ref.maintainers.contains(&public_key)
203 "WARNING: failed to fetch branch {branch_name} error: {error}" 203 || events_to_apply.iter().any(|e| e.pubkey.eq(&public_key))
204 ) 204 {
205 .as_str(), 205 term.write_line(
206 ); 206 format!("WARNING (only shown to maintainers or author): failed to fetch branch {branch_name}, error: {error}",)
207 .as_str(),
208 )?;
209 }
210 }
207 } 211 }
208 } 212 }
209 } 213 }