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:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-12-20 09:59:14 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-12-20 10:17:27 +0000
commit316f858f223162408cfd52183ef7645828c2f480 (patch)
tree4f275320ad776ed4fcc85a1d75b2ac2c46c63609 /src/bin/git_remote_nostr/list.rs
parent8cc4a21061433c9a29e36c4f33e4d84bea1defee (diff)
refactor: branch_name handling
improve clarity by renaming variables and methods defend against `branch-name` tag with an unsafe name
Diffstat (limited to 'src/bin/git_remote_nostr/list.rs')
-rw-r--r--src/bin/git_remote_nostr/list.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index 07c6f59..f361272 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -149,10 +149,10 @@ async fn get_open_proposals_state(
149 let current_user = get_curent_user(git_repo)?; 149 let current_user = get_curent_user(git_repo)?;
150 for (_, (proposal, patches)) in open_proposals { 150 for (_, (proposal, patches)) in open_proposals {
151 if let Ok(cl) = event_to_cover_letter(&proposal) { 151 if let Ok(cl) = event_to_cover_letter(&proposal) {
152 if let Ok(mut branch_name) = cl.get_branch_name() { 152 if let Ok(mut branch_name) = cl.get_branch_name_with_pr_prefix_and_shorthand_id() {
153 branch_name = if let Some(public_key) = current_user { 153 branch_name = if let Some(public_key) = current_user {
154 if proposal.pubkey.eq(&public_key) { 154 if proposal.pubkey.eq(&public_key) {
155 format!("pr/{}", cl.branch_name) 155 format!("pr/{}", cl.branch_name_without_id_or_prefix)
156 } else { 156 } else {
157 branch_name 157 branch_name
158 } 158 }