summary refs log tree commit diff
path: root/pkgs/build-support/fetchgit
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-03-18 19:47:19 +0000
committerzimbatm <zimbatm@zimbatm.com>2016-03-23 11:22:51 +0000
commit40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e (patch)
tree6d5e5e710076fde63186d456cf3dd0a7c934b4b0 /pkgs/build-support/fetchgit
parent89fd50144182633ecb42a60d21523896f1bd9acc (diff)
downloadnixpkgs-40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e.tar
nixpkgs-40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e.tar.gz
nixpkgs-40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e.tar.bz2
nixpkgs-40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e.tar.lz
nixpkgs-40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e.tar.xz
nixpkgs-40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e.tar.zst
nixpkgs-40e9dff04a4a61b6fde13d3fc32ddd46f1ad3d7e.zip
nix-prefetch-git: fix url_to_name heuristic
The function wasn't checking that *all* of the characters where
[a-z0-9]. Fixes #13921
Diffstat (limited to 'pkgs/build-support/fetchgit')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 2af01ee5373..9352757ea80 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -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