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/list.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index 23b3b98..a17090e 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -58,10 +58,14 @@ pub async fn run_list(
58 // (b) already available locally. 58 // (b) already available locally.
59 // This prevents advertising refs whose git objects haven't been pushed to 59 // This prevents advertising refs whose git objects haven't been pushed to
60 // any server yet, which would cause `git clone` / `git fetch` to fail. 60 // any server yet, which would cause `git clone` / `git fetch` to fail.
61 //
62 // filter by maintainers to avoid state events from other remotes with the
63 // same identifier being selected when they have a newer created_at
61 let mut candidates: Vec<&nostr::Event> = fetch_report 64 let mut candidates: Vec<&nostr::Event> = fetch_report
62 .state_per_relay 65 .state_per_relay
63 .values() 66 .values()
64 .filter_map(|maybe| maybe.as_ref()) 67 .filter_map(|maybe| maybe.as_ref())
68 .filter(|event| repo_ref.maintainers.contains(&event.pubkey))
65 .collect(); 69 .collect();
66 // Sort newest-first (by created_at, then by id for tie-breaking). 70 // Sort newest-first (by created_at, then by id for tie-breaking).
67 candidates.sort_by(|a, b| { 71 candidates.sort_by(|a, b| {