about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support')
-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 2af01ee5373b..9352757ea806 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