From 45aa4e2d7f27f593edb0ca6c4f0ee8cf7c4f1332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 25 Jan 2010 13:23:08 +0000 Subject: [PATCH] nix-prefetch-git: Add support for $NIX_PREFETCH_GIT_DEEP_CLONE. svn path=/nixpkgs/trunk/; revision=19648 --- pkgs/build-support/fetchgit/nix-prefetch-git | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 9207b84ddec1..63d756c5807c 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;