From 21aa949615487037efbb8957786316b6dd9cee17 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 27 Aug 2016 22:31:28 -0700 Subject: [PATCH] clone.sh: sync up minor logic with update.sh Avoid unpacking the initial clone of a tiny project. Avoid pruning when fetch.prune is explicitly false. Signed-off-by: Kyle J. McKay --- taskd/clone.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/taskd/clone.sh b/taskd/clone.sh index 4688d94..2980320 100755 --- a/taskd/clone.sh +++ b/taskd/clone.sh @@ -390,6 +390,12 @@ case "$url" in # it. We do not support a HEAD symref to anything other than refs/heads/... [ -n "$headref" ] || headref="refs/heads/master" git symbolic-ref HEAD "$headref" + pruneopt=--prune + [ "$(git config --bool fetch.prune 2>/dev/null || :)" != "false" ] || pruneopt= + git_add_config 'fetch.unpackLimit=1' + # Note the git config documentation is wrong + # transfer.unpackLimit, if set, overrides fetch.unpackLimit + git_add_config 'transfer.unpackLimit=1' # remember the starting time so we can easily detect new packs for fast-import mirrors # we sleep for 1 second after creating .gfipack to make sure all packs are newer if is_gfi_mirror_url "$url" && [ ! -e .gfipack ]; then @@ -397,8 +403,8 @@ case "$url" in >.gfipack sleep 1 fi - GIT_SSL_NO_VERIFY=1 git remote update --prune - if is_gfi_mirror_url "$url"; then + GIT_SSL_NO_VERIFY=1 git remote update $pruneopt + if [ -e .gfipack ] && is_gfi_mirror_url "$url"; then find objects/pack -type f -newer .gfipack -name "pack-$octet20.pack" -print >>gfi-packs rm -f .gfipack fi -- 2.11.4.GIT