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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
09149c7809
commit
6b9ff1e3bd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user