Skip to content

Conversation

xokdvium
Copy link

Prior to this patch the code correctly barfed on
control characters with values lower than \040 (space), but failed to account for DEL.

This patch fixes the behavior to be consistent with git 1:

They cannot have ASCII control characters (i.e. bytes whose values are
lower than \040, or \177 DEL)

Prior to this patch the code correctly barfed on
control characters with values lower than \040 (space),
but failed to account for DEL.

This patch fixes the behavior to be consistent with git [1]:

> They cannot have ASCII control characters (i.e. bytes whose values are
> lower than \040, or \177 DEL)

[1]: https://git-scm.com/docs/git-check-ref-format#_description
@xokdvium
Copy link
Author

@pks-t, could you take a quick look?

We've started using libgit2 refname validation logic in Nix (NixOS/nix#13729) and found that libgit2 is not entirely correct it seems.

It would also be great to expose additional knobs for checking shorthand refnames directly, without going through the git_reference_normalize_name, but that's a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant