Check if pack directory exists prior to descending into it
authorMatthias Kestenholz <matthias@spinlock.ch>
Tue, 29 Aug 2006 09:12:14 +0000 (11:12 +0200)
committerJunio C Hamano <junkio@cox.net>
Tue, 29 Aug 2006 09:17:15 +0000 (02:17 -0700)
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-repack.sh

index 9da92fb06139dc53061876f1532d9ee8c46d5346..584a7323acd79e4092910ec4415f51603eccea61 100755 (executable)
@@ -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