Skip to content

Commit

Permalink
Ensure git-repack -a -d --max-pack-size=N deletes correct packs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dana How authored and Junio C Hamano committed May 25, 2007
1 parent 01c12a2 commit dca3957
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions git-repack.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dca3957

Please sign in to comment.