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:
parent
71fe367e8c
commit
1e5a389a2f
4 changed files with 29 additions and 45 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue