summaryrefslogtreecommitdiffstats
path: root/pkgs/build-support/fetchgit/nix-prefetch-git
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/fetchgit/nix-prefetch-git')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 661e0d674c58..8110d670e41c 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -140,7 +140,7 @@ url_to_name(){
fi
}
-# Fetch everything and checkout the right sha1
+# Fetch and checkout the right sha1
checkout_hash(){
local hash="$1"
local ref="$2"
@@ -149,6 +149,7 @@ checkout_hash(){
hash=$(hash_from_ref "$ref")
fi
+ clean_git fetch ${builder:+--progress} --depth=1 origin "$hash" || \
clean_git fetch -t ${builder:+--progress} origin || return 1
local object_type=$(git cat-file -t "$hash")