Skip to contentSkip to conversation

Check if pack directory exists prior to descending into it

PATCH In review Matthias Kestenholz 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Check if pack directory exists prior to descending into it

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.

---
 git-repack.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-repack.sh +1 -1
index 9da92fb..584a732 100755
@@ -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
Signature · 1 line
1.4.2.g2f76