From 316f858f223162408cfd52183ef7645828c2f480 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 20 Dec 2024 09:59:14 +0000 Subject: refactor: branch_name handling improve clarity by renaming variables and methods defend against `branch-name` tag with an unsafe name --- src/bin/git_remote_nostr/list.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bin/git_remote_nostr/list.rs') 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( let current_user = get_curent_user(git_repo)?; for (_, (proposal, patches)) in open_proposals { if let Ok(cl) = event_to_cover_letter(&proposal) { - if let Ok(mut branch_name) = cl.get_branch_name() { + if let Ok(mut branch_name) = cl.get_branch_name_with_pr_prefix_and_shorthand_id() { branch_name = if let Some(public_key) = current_user { if proposal.pubkey.eq(&public_key) { - format!("pr/{}", cl.branch_name) + format!("pr/{}", cl.branch_name_without_id_or_prefix) } else { branch_name } -- cgit v1.2.3