From: Nguyễn Thái Ngọc Duy Date: Sat, 27 Oct 2007 07:47:21 +0000 (+0700) Subject: git-sh-setup.sh: use "git rev-parse --show-cdup" to check for SUBDIRECTORY_OK X-Git-Tag: v1.5.4-rc0~298^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6b9ff1e3bd089d1bef211ba74c12e056810755b8;p=git.git git-sh-setup.sh: use "git rev-parse --show-cdup" to check for SUBDIRECTORY_OK "git rev-parse --git-dir" trick does not play well with worktree Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 3c325fd13..86d7d4c4e 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -110,7 +110,7 @@ esac if [ -z "$SUBDIRECTORY_OK" ] then : ${GIT_DIR=.git} - GIT_DIR=$(GIT_DIR="$GIT_DIR" git rev-parse --git-dir) || { + test -z "$(git rev-parse --show-cdup)" || { exit=$? echo >&2 "You need to run this command from the toplevel of the working tree." exit $exit