[PATCH] Check if pack directory exists prior to descending into it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes the following warning:

git-repack: line 42: cd: .git/objects/pack: No such file or directory

This happens only, when git-repack -a is run without any packs in the
repository.

Signed-off-by: Matthias Kestenholz <matthias@xxxxxxxxxxx>
---
 git-repack.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-repack.sh b/git-repack.sh
index 9da92fb..584a732 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -38,7 +38,7 @@ case ",$all_into_one," in
 	pack_objects=
 
 	# Redundancy check in all-into-one case is trivial.
-	existing=`cd "$PACKDIR" && \
+	existing=`test -d "$PACKDIR" && cd "$PACKDIR" && \
 	    find . -type f \( -name '*.pack' -o -name '*.idx' \) -print`
 	;;
 esac
-- 
1.4.2.g2f76

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]