From 178613c737f82489a1e2c387236731541fe19081 Mon Sep 17 00:00:00 2001
From: Martin Waitz <tali@admingilde.org>
Date: Sun, 7 May 2006 20:18:53 +0200
Subject: [PATCH] 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>
---
 git-repack.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/git-repack.sh b/git-repack.sh
index a5d349fd099..20774fbd7e2 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -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
+else
+	echo "Pack pack-$name created."
+
+	mkdir -p "$PACKDIR" || exit
+
+	mv .tmp-pack-$name.pack "$PACKDIR/pack-$name.pack" &&
+	mv .tmp-pack-$name.idx  "$PACKDIR/pack-$name.idx" ||
+	exit
 fi
-echo "Pack pack-$name created."
-
-mkdir -p "$PACKDIR" || exit
-
-mv .tmp-pack-$name.pack "$PACKDIR/pack-$name.pack" &&
-mv .tmp-pack-$name.idx  "$PACKDIR/pack-$name.idx" ||
-exit
 
 if test "$remove_redundant" = t
 then