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 fi
# Allow doing additional processing before .git removal # Allow doing additional processing before .git removal
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK" 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. # Compute the hash.
hash=$(nix-hash --type $hashType $hashFormat $tmpFile) hash=$(nix-hash --type $hashType $hashFormat $tmpFile)