diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/ngit/sub_commands/sync.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/ngit/sub_commands/sync.rs b/src/bin/ngit/sub_commands/sync.rs index 61c13a8..5578a0f 100644 --- a/src/bin/ngit/sub_commands/sync.rs +++ b/src/bin/ngit/sub_commands/sync.rs | |||
| @@ -116,10 +116,7 @@ pub async fn launch(args: &SubCommandArgs) -> Result<()> { | |||
| 116 | continue; | 116 | continue; |
| 117 | } | 117 | } |
| 118 | } | 118 | } |
| 119 | if nostr_ref_name.starts_with("refs/heads/") | 119 | if invalid_nostr_state_ref(nostr_ref_name) { |
| 120 | || nostr_ref_name.starts_with("refs/tags/") | ||
| 121 | || !nostr_ref_name.starts_with("refs/heads/pr/") | ||
| 122 | { | ||
| 123 | // ensure nostr_state only supports refs/heads and refs/tags/ | 120 | // ensure nostr_state only supports refs/heads and refs/tags/ |
| 124 | // and not refs/heads/prs/* | 121 | // and not refs/heads/prs/* |
| 125 | } else if let Some(remote_ref_value) = remote_state.get(nostr_ref_name) { | 122 | } else if let Some(remote_ref_value) = remote_state.get(nostr_ref_name) { |
| @@ -214,3 +211,8 @@ pub async fn launch(args: &SubCommandArgs) -> Result<()> { | |||
| 214 | 211 | ||
| 215 | Ok(()) | 212 | Ok(()) |
| 216 | } | 213 | } |
| 214 | |||
| 215 | fn invalid_nostr_state_ref(ref_name: &str) -> bool { | ||
| 216 | ref_name.starts_with("refs/heads/pr/") | ||
| 217 | && !(ref_name.starts_with("refs/heads/") || ref_name.starts_with("refs/tags/")) | ||
| 218 | } | ||