summaryrefslogtreecommitdiff
path: root/git-repack.sh
diff options
context:
space:
mode:
authorLukas Sandström <lukass@etek.chalmers.se>2005-11-18 21:36:12 +0100
committerJunio C Hamano <junkio@cox.net>2005-11-18 14:26:31 -0800
commit62af0b532b5ab94d231205db2db444a638a4ce49 (patch)
tree82ec6b7e506c6d076a008394b64f3addb20e35f4 /git-repack.sh
parent4d16f8de16e4caa278c850f812eef2cde9980b35 (diff)
downloadgit-62af0b532b5ab94d231205db2db444a638a4ce49.tar.gz
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 <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-repack.sh')
-rwxr-xr-xgit-repack.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/git-repack.sh b/git-repack.sh
index e58fdd6d87..55a7b27dcd 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