nix-prefetch-git: fix url_to_name heuristic
The function wasn't checking that *all* of the characters where [a-z0-9]. Fixes #13921
This commit is contained in:
parent
d05a3cd763
commit
ae487615a6
|
@ -118,7 +118,7 @@ url_to_name(){
|
||||||
# basename removes the / and .git suffixes
|
# basename removes the / and .git suffixes
|
||||||
local base=$(basename "$url" .git)
|
local base=$(basename "$url" .git)
|
||||||
|
|
||||||
if [[ $ref =~ [a-z0-9]+ ]]; then
|
if [[ $ref =~ ^[a-z0-9]+$ ]]; then
|
||||||
echo "$base-${ref:0:7}"
|
echo "$base-${ref:0:7}"
|
||||||
else
|
else
|
||||||
echo $base
|
echo $base
|
||||||
|
|
Loading…
Reference in New Issue