From 4bd46c3cf7bacb062d45d3c99d3edfadc95cb139 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 3 Sep 2025 16:57:14 +0100 Subject: fix(remote): `refs/pr-by-id/*` ~> `refs/pr/*/head` to align more closely with githubs `refs/pull/*/head` we can pretend that pr means both Patch Request and Pull Request --- src/bin/git_remote_nostr/list.rs | 6 +++--- tests/git_remote_nostr/list.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs index e6a4680..af71674 100644 --- a/src/bin/git_remote_nostr/list.rs +++ b/src/bin/git_remote_nostr/list.rs @@ -84,7 +84,7 @@ pub async fn run_list( ); state.extend( - // get as refs/pr/() and refs/pr-by-id/ + // get as refs/pr/() and refs/pr//head get_all_proposals_state(git_repo, repo_ref).await?, ); @@ -240,13 +240,13 @@ async fn get_all_proposals_state( { if let Ok(tip) = tag_value(pr_or_pr_update, "c") { state.insert(format!("refs/{branch_name}"), tip.clone()); - state.insert(format!("refs/pr-by-id/{}", proposal.id), tip); + state.insert(format!("refs/pr/{}/head", proposal.id), tip); } } else if let Ok(tip) = make_commits_for_proposal(git_repo, repo_ref, &events_to_apply) { state.insert(format!("refs/{branch_name}"), tip.clone()); - state.insert(format!("refs/pr-by-id/{}", proposal.id), tip); + state.insert(format!("refs/pr/{}/head", proposal.id), tip); } } } diff --git a/tests/git_remote_nostr/list.rs b/tests/git_remote_nostr/list.rs index 50ea350..1972cd5 100644 --- a/tests/git_remote_nostr/list.rs +++ b/tests/git_remote_nostr/list.rs @@ -328,7 +328,7 @@ mod with_state_announcement { pr_refs.push(format!("{tip} refs/heads/{branch_name}")); pr_refs.push(format!("{tip} refs/{branch_name}")); let proposal_id = get_proposal_id_from_branch_name(&r55.events, name)?; - pr_refs.push(format!("{tip} refs/pr-by-id/{proposal_id}")); + pr_refs.push(format!("{tip} refs/pr/{proposal_id}/head")); } assert_eq!( -- cgit v1.2.3