1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-21 16:31:07 +01:00

libfetchers/git-utils: Be more correct about validating refnames

Turns out there's a much better API for this that doesn't have the
footguns of the previous method.

isLegalRefName is somewhat of a misnomer, since it's mainly used to
validate user inputs that can be either references, branch names,
psedorefs or tags.

(cherry picked from commit 5d1178b817)
This commit is contained in:
Sergei Zimmerman 2025-10-15 21:54:09 +03:00 committed by github-actions[bot]
parent 71fe367e8c
commit 1e5a389a2f
4 changed files with 29 additions and 45 deletions

View file

@ -59,6 +59,9 @@ invalid_ref() {
}
valid_ref 'A/b'
valid_ref 'AaA/b'
valid_ref 'FOO/BAR/BAZ'
valid_ref 'foox'
valid_ref '1337'
valid_ref 'foo.baz'