diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-20 09:59:14 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-20 10:17:27 +0000 |
| commit | 316f858f223162408cfd52183ef7645828c2f480 (patch) | |
| tree | 4f275320ad776ed4fcc85a1d75b2ac2c46c63609 /src/bin/git_remote_nostr/utils.rs | |
| parent | 8cc4a21061433c9a29e36c4f33e4d84bea1defee (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/utils.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/git_remote_nostr/utils.rs b/src/bin/git_remote_nostr/utils.rs index 15ebb10..316fedb 100644 --- a/src/bin/git_remote_nostr/utils.rs +++ b/src/bin/git_remote_nostr/utils.rs | |||
| @@ -184,10 +184,10 @@ pub async fn get_all_proposals( | |||
| 184 | 184 | ||
| 185 | pub fn find_proposal_and_patches_by_branch_name<'a>( | 185 | pub fn find_proposal_and_patches_by_branch_name<'a>( |
| 186 | refstr: &'a str, | 186 | refstr: &'a str, |
| 187 | open_proposals: &'a HashMap<EventId, (Event, Vec<Event>)>, | 187 | proposals: &'a HashMap<EventId, (Event, Vec<Event>)>, |
| 188 | current_user: Option<&PublicKey>, | 188 | current_user: Option<&PublicKey>, |
| 189 | ) -> Option<(&'a EventId, &'a (Event, Vec<Event>))> { | 189 | ) -> Option<(&'a EventId, &'a (Event, Vec<Event>))> { |
| 190 | open_proposals.iter().find(|(_, (proposal, _))| { | 190 | proposals.iter().find(|(_, (proposal, _))| { |
| 191 | is_event_proposal_root_for_branch(proposal, refstr, current_user).unwrap_or(false) | 191 | is_event_proposal_root_for_branch(proposal, refstr, current_user).unwrap_or(false) |
| 192 | }) | 192 | }) |
| 193 | } | 193 | } |