upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-08-15 12:39:01 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2025-08-15 12:39:01 +0100
commitb404cfa7b622297b30ec509dde2aa4b14a4beac3 (patch)
tree50221071f6fa30ea99087f1083927bf7b88cff92
parent92c2362a9bed1bc1f256e7948e087c4102b7c4f9 (diff)
fix: inaccessable PR commits breaks `git clone`
we cannot list PRs under refs/heads/pr/* unless we are sure the oids are accessable on a git server as it will cause `git clone` to fail. we now only list PRs that are on accessable repo git servers under refs/heads/pr/*. we should be able to list them under under refs/pr/* as the clone command only fetches refs in refs/heads so we will do this seperately.
-rw-r--r--src/bin/git_remote_nostr/list.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index df98c12..3159e0a 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -166,7 +166,18 @@ async fn get_open_and_draft_proposals_state(
166 { 166 {
167 match tag_value(pr_or_pr_update, "c") { 167 match tag_value(pr_or_pr_update, "c") {
168 Ok(tip) => { 168 Ok(tip) => {
169 state.insert(format!("refs/heads/{branch_name}"), tip); 169 // only list Pull Requests as refs/heads/pr/* if data is on a repo git
170 // server otherwise the standard `git clone
171 // nostr://` cmd will fail as it assumes all /refs/heads returned by
172 // list are accessable
173 let tip_oid_is_on_a_repo_git_server =
174 remote_states.iter().any(|(_url, (state, _is_grasp))| {
175 state.iter().any(|(_, oid)| tip == *oid)
176 });
177
178 if tip_oid_is_on_a_repo_git_server {
179 state.insert(format!("refs/heads/{branch_name}"), tip);
180 }
170 } 181 }
171 Err(_) => { 182 Err(_) => {
172 let _ = term.write_line( 183 let _ = term.write_line(