repack: honor -d even when no new pack was created
authorMartin Waitz <tali@admingilde.org>
Sun, 7 May 2006 18:18:53 +0000 (20:18 +0200)
committerJunio C Hamano <junkio@cox.net>
Sun, 7 May 2006 22:35:50 +0000 (15:35 -0700)
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>
git-repack.sh

index a5d349fd099a8d2a411d1b71ef8a6ff5d368ba32..20774fbd7e281e91c2a3b97d19284ab5282ccaf1 100755 (executable)
@@ -46,15 +46,15 @@ name=$(git-rev-list --objects --all $rev_list 2>&1 |
        exit 1
 if [ -z "$name" ]; then
        echo Nothing new to pack.
-       exit 0
-fi
-echo "Pack pack-$name created."
+else
+       echo "Pack pack-$name created."
 
-mkdir -p "$PACKDIR" || exit
+       mkdir -p "$PACKDIR" || exit
 
-mv .tmp-pack-$name.pack "$PACKDIR/pack-$name.pack" &&
-mv .tmp-pack-$name.idx  "$PACKDIR/pack-$name.idx" ||
-exit
+       mv .tmp-pack-$name.pack "$PACKDIR/pack-$name.pack" &&
+       mv .tmp-pack-$name.idx  "$PACKDIR/pack-$name.idx" ||
+       exit
+fi
 
 if test "$remove_redundant" = t
 then