@matheusbsbs / matheus-bagliano / commits / dca3957b85
Fork 0

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>

Dana How committed May 24, 2007 at 19:06 UTC dca3957b8581ffd0faab135191bbee3029953bd2
1 file changed +3 -2
git-repack.sh
+3 -2
@@ -69,6 +69,7 @@ if [ -z "$names" ]; then
69 echo Nothing new to pack.
70 fi
71 for name in $names ; do
72 + fullbases="$fullbases pack-$name"
73 chmod a-w "$PACKTMP-$name.pack"
74 chmod a-w "$PACKTMP-$name.idx"
75 if test "$quiet" != '-q'; then
@@ -105,8 +106,8 @@ then
106 ( cd "$PACKDIR" &&
107 for e in $existing
108 do
108 - case "$e" in
109 - pack-$name) ;;
109 + case " $fullbases " in
110 + *" $e "*) ;;
111 *) rm -f "$e.pack" "$e.idx" "$e.keep" ;;
112 esac
113 done