git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Matthias Kestenholz <matthias@spinlock.ch>
Date
Aug 29, 2006, 09:12 UTC
Message-ID
<20060829091214.GA10155@spinlock.ch>
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(-)
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
Next: Junio C Hamano
Message 1 of 2 in “Check if pack directory exists prior to descending into it”
  1. Check if pack directory exists prior to descending into itMatthias Kestenholz, Aug 29, 2006
  2. Junio C HamanoAug 29, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.