From 456cbb29d9ba0cd518e82d2c2dc68e665629595e Mon Sep 17 00:00:00 2001 From: Tim Cuthbertson Date: Sun, 13 Dec 2015 11:27:03 +1100 Subject: [PATCH] nix-prefetch-git: add --quiet flag and minor cleanup --- pkgs/build-support/fetchgit/nix-prefetch-git | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 97096aa29806..f81b896e33b0 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -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