about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-01-25 13:23:08 +0000
committerLudovic Courtès <ludo@gnu.org>2010-01-25 13:23:08 +0000
commit45aa4e2d7f27f593edb0ca6c4f0ee8cf7c4f1332 (patch)
tree4cb5a9d4657e03987f7b0382e52e8ba830469969 /pkgs/build-support
parentd1c34b3a4740138f833c803dfe2c2b0130fe045e (diff)
nix-prefetch-git: Add support for $NIX_PREFETCH_GIT_DEEP_CLONE.
svn path=/nixpkgs/trunk/; revision=19648
Diffstat (limited to 'pkgs/build-support')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 9207b84ddec1a..63d756c5807cb 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -60,6 +60,14 @@ checkout_ref(){
     local hash="$1";
     local ref="$2";
 
+    if test -n "$NIX_PREFETCH_GIT_DEEP_CLONE"; then
+	# The caller explicitly asked for a deep clone.  Deep clones
+	# allow "git describe" and similar tools to work.  See
+	# http://thread.gmane.org/gmane.linux.distributions.nixos/3569
+	# for a discussion.
+	return 1
+    fi
+
     if test -z "$ref"; then
         ref=$(ref_from_hash $hash);
     fi;