Skip to content

Commit

Permalink
fix: partial_ref_name
Browse files Browse the repository at this point in the history
The previous commit was a bit overzealous in combining error conditions
in partial_ref_name().
  • Loading branch information
jpgrayson committed Feb 16, 2025
1 parent f4e18de commit e77754e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wrap/partialrefname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ pub(crate) fn partial_ref_name(input: &mut &str) -> ModalResult<PartialRefName>

let name = input.next_slice(split_offset);

if name.is_empty() || name == "-" || name.ends_with(".lock") {
if name.is_empty() || name == "-" {
Err(ErrMode::Backtrack(ContextError::from_input(input)))
} else if name.ends_with(".lock") {
// Names ending with ".lock" are invalid and there is no recovery.
Err(ErrMode::Cut(ContextError::from_input(input)))
} else {
Expand Down

0 comments on commit e77754e

Please sign in to comment.