@matheusbsbs / matheus-bagliano / commits / 6b9ff1e3bd
Fork 0

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>

Nguyễn Thái Ngọc Duy committed Oct 27, 2007 at 14:47 UTC 6b9ff1e3bd089d1bef211ba74c12e056810755b8
1 file changed +1 -1
git-sh-setup.sh
+1 -1
@@ -110,7 +110,7 @@ esac
110 if [ -z "$SUBDIRECTORY_OK" ]
111 then
112 : ${GIT_DIR=.git}
113 - GIT_DIR=$(GIT_DIR="$GIT_DIR" git rev-parse --git-dir) || {
113 + test -z "$(git rev-parse --show-cdup)" || {
114 exit=$?
115 echo >&2 "You need to run this command from the toplevel of the working tree."
116 exit $exit