mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
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
89fd501441
commit
40e9dff04a
@ -118,7 +118,7 @@ url_to_name(){
|
||||
# basename removes the / and .git suffixes
|
||||
local base=$(basename "$url" .git)
|
||||
|
||||
if [[ $ref =~ [a-z0-9]+ ]]; then
|
||||
if [[ $ref =~ ^[a-z0-9]+$ ]]; then
|
||||
echo "$base-${ref:0:7}"
|
||||
else
|
||||
echo $base
|
||||
|
Loading…
Reference in New Issue
Block a user