Skip to content

Commit

Permalink
Archive-destroying "git repack -a -d" bug.
Browse files Browse the repository at this point in the history
Using "git repack -a -d" can destroy your git archive if you use it
twice in succession, because the new pack can be called the same as
the old pack.  Found by Linus.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Sep 18, 2005
1 parent 434d036 commit 490e23d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion git-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ then
# all-into-one is used.
if test "$all_into_one" != '' && test "$existing" != ''
then
( cd "$PACKDIR" && rm -f $existing )
( cd "$PACKDIR" &&
for e in $existing
do
case "$e" in
./pack-$name.pack | ./pack-$name.idx) ;;
*) rm -f $e ;;
esac
done
)
fi
fi

Expand Down

0 comments on commit 490e23d

Please sign in to comment.