nix-prefetch-git: add --quiet flag and minor cleanup

This commit is contained in:
Tim Cuthbertson 2015-12-13 11:27:03 +11:00
parent 96425dfa09
commit 456cbb29d9

View File

@ -52,6 +52,7 @@ for arg; do
--hash) argfun=set_hashType;;
--branch-name) argfun=set_branchName;;
--deepClone) deepClone=true;;
--quiet) QUIET=true;;
--no-deepClone) deepClone=false;;
--leave-dotGit) leaveDotGit=true;;
--fetch-submodules) fetchSubmodules=true;;
@ -281,9 +282,9 @@ clone_user_rev() {
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"
if test -z "$leaveDotGit"; then
echo "removing \`.git'..." >&2
find $dir -name .git\* | xargs rm -rf
find "$dir" -name .git\* -print0 | xargs -0 rm -rf
else
find $dir -name .git | while read gitdir; do
find "$dir" -name .git | while read gitdir; do
make_deterministic_repo "$(readlink -f "$gitdir/..")"
done
fi