aboutsummaryrefslogtreecommitdiff
path: root/git-repack.sh
diff options
context:
space:
mode:
authorDana How <danahow@gmail.com>2007-05-24 19:06:42 -0700
committerJunio C Hamano <junkio@cox.net>2007-05-24 19:45:14 -0700
commitdca3957b8581ffd0faab135191bbee3029953bd2 (patch)
treeb32bd8e024be57bcbb152273ac938385c4e1cc70 /git-repack.sh
parent01c12a23121780b7b1d84943fe310cf8773f8745 (diff)
downloadgit-dca3957b8581ffd0faab135191bbee3029953bd2.tar.gz
git-dca3957b8581ffd0faab135191bbee3029953bd2.tar.xz
Ensure git-repack -a -d --max-pack-size=N deletes correct packs
The packfile portion of the "remove redundant" code near the bottom of git-repack.sh is broken when pack splitting occurs. Particularly since this is the only place where we automatically delete packfiles, make sure it works properly for all cases, old or new. Signed-off-by: Dana L. How <danahow@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-repack.sh')
-rwxr-xr-xgit-repack.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-repack.sh b/git-repack.sh
index 4ea6e5b9e..8c32724be 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -69,6 +69,7 @@ if [ -z "$names" ]; then
echo Nothing new to pack.
fi
for name in $names ; do
+ fullbases="$fullbases pack-$name"
chmod a-w "$PACKTMP-$name.pack"
chmod a-w "$PACKTMP-$name.idx"
if test "$quiet" != '-q'; then
@@ -105,8 +106,8 @@ then
( cd "$PACKDIR" &&
for e in $existing
do
- case "$e" in
- pack-$name) ;;
+ case " $fullbases " in
+ *" $e "*) ;;
*) rm -f "$e.pack" "$e.idx" "$e.keep" ;;
esac
done