From ae487615a635cc5cde0dc500a3c44b25a1dfdb40 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Fri, 18 Mar 2016 19:47:19 +0000 Subject: [PATCH] nix-prefetch-git: fix url_to_name heuristic The function wasn't checking that *all* of the characters where [a-z0-9]. Fixes #13921 --- pkgs/build-support/fetchgit/nix-prefetch-git | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 2c9d61504ed2..97c983dbe8da 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