nix-prefetch-git: Support $NIX_PREFETCH_GIT_LEAVE_DOT_GIT.

svn path=/nixpkgs/trunk/; revision=18442
This commit is contained in:
Ludovic Courtès 2009-11-18 16:39:06 +00:00
parent 3124661215
commit 39476057a2

View file

@ -44,7 +44,11 @@ if test -z "$finalPath"; then
fi
# Allow doing additional processing before .git removal
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"
find $tmpFile -name .git\* | xargs rm -rf
if test "$NIX_PREFETCH_GIT_LEAVE_DOT_GIT" != 1
then
echo "removing \`.git'..."
rm -rf .git
fi
# Compute the hash.
hash=$(nix-hash --type $hashType $hashFormat $tmpFile)