threads / patch / 5425

patchCheck if pack directory exists prior to descending into it

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

## tl;dr

2 messages between Aug 29, 2006 and Aug 29, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Matthias Kestenholz· Aug 29, 2006, 09:12 UTC · lore
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@spinlock.ch>
---
 git-repack.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-repack.sh +1 −1
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

← back to recent threads