diff --git a/scripts/nightly-release-plan.sh b/scripts/nightly-release-plan.sh index dc0c0fd2..8dccc26a 100755 --- a/scripts/nightly-release-plan.sh +++ b/scripts/nightly-release-plan.sh @@ -32,7 +32,9 @@ if [ -z "$REPOSITORY" ]; then echo "usage: $0 [branch]" >&2 exit 2 fi -if [ ! -d "$REPOSITORY/.git" ]; then +# `.git` may be a directory (normal clone) or a file (worktree/submodule), so +# ask git itself rather than testing for the directory. +if ! git -C "$REPOSITORY" rev-parse --git-dir >/dev/null 2>&1; then echo "error: $REPOSITORY is not a git checkout" >&2 exit 1 fi