Skip to content

Commit 178613c

Browse files
taliJunio C Hamano
authored andcommitted
repack: honor -d even when no new pack was created
If all objects are reachable via an alternate object store then we still have to remove all obsolete local packs. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent cf9dc65 commit 178613c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

git-repack.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ name=$(git-rev-list --objects --all $rev_list 2>&1 |
4646
exit 1
4747
if [ -z "$name" ]; then
4848
echo Nothing new to pack.
49-
exit 0
50-
fi
51-
echo "Pack pack-$name created."
49+
else
50+
echo "Pack pack-$name created."
5251

53-
mkdir -p "$PACKDIR" || exit
52+
mkdir -p "$PACKDIR" || exit
5453

55-
mv .tmp-pack-$name.pack "$PACKDIR/pack-$name.pack" &&
56-
mv .tmp-pack-$name.idx "$PACKDIR/pack-$name.idx" ||
57-
exit
54+
mv .tmp-pack-$name.pack "$PACKDIR/pack-$name.pack" &&
55+
mv .tmp-pack-$name.idx "$PACKDIR/pack-$name.idx" ||
56+
exit
57+
fi
5858

5959
if test "$remove_redundant" = t
6060
then

0 commit comments

Comments
 (0)