Make ghmerge compatible with Git worktrees
authorHugo Landau <hlandau@openssl.org>
Tue, 7 Nov 2023 07:38:09 +0000 (07:38 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 8 Nov 2023 11:02:32 +0000 (12:02 +0100)
Git worktrees have .git be a file containing a string identifying the
location of the real .git directory. Thus -d will not match these
worktrees. Use -e instead.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/tools/pull/171)

review-tools/ghmerge

index 38733165bb40bcd609d9019354bcdcb0e8e8efa7..128bdb73d57ca37ffaf9194f4797bf8f0ba325a9 100755 (executable)
@@ -40,7 +40,7 @@ TARGET=""
 BUILD=yes
 [ -z ${CC+x} ] && CC="ccache gcc" # opensslbuild will otherwise use "ccache clang-3.6"
 
-if [ ! -d .git ] ; then
+if [ ! -e .git ] ; then
     echo Not at a top-level git directory
     exit 1
 fi