From: Lukas Sandström Date: Fri, 18 Nov 2005 20:36:12 +0000 (+0100) Subject: Remove all old packfiles when doing "git repack -a -d" X-Git-Tag: v0.99.9k~1^2~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=62af0b532b5ab94d231205db2db444a638a4ce49;p=git.git Remove all old packfiles when doing "git repack -a -d" No point in running git-pack-redundant if we already know which packs are redundant. Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano --- diff --git a/git-repack.sh b/git-repack.sh index e58fdd6d..55a7b27d 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -63,9 +63,22 @@ exit if test "$remove_redundant" = t then sync - redundant=$(git-pack-redundant --all) - if test "$redundant" != "" ; then - echo $redundant | xargs rm + if test "$all_into_one" = t + then + cd "$PACKDIR" + existing=`find . -type f \( -name '*.pack' -o -name '*.idx' \) -print` + for e in $existing + do + case "$e" in + ./pack-$name.pack | ./pack-$name.idx) ;; + *) rm -f $e ;; + esac + done + else + redundant=$(git-pack-redundant --all) + if test "$redundant" != "" ; then + echo $redundant | xargs rm + fi fi fi