{"thread":{"id":"10480","subject":"[PATCH] git-sh-setup.sh: use \"git rev-parse --show-cdup\" to check for SUBDIRECTORY_OK","startedAt":"2007-10-27T07:47:21Z","lastAt":"2007-10-27T07:47:21Z","messageCount":1,"participants":["Nguyễn Thái Ngọc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"57331","messageId":"20071027074721.GA12606@laptop","threadId":"10480","inReplyTo":null,"subject":"[PATCH] git-sh-setup.sh: use \"git rev-parse --show-cdup\" to check for SUBDIRECTORY_OK","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2007-10-27T07:47:21Z","receivedAt":"2007-10-27T07:47:21Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\"git rev-parse --git-dir\" trick does not play well with worktree\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n git-sh-setup.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex 3c325fd..86d7d4c 100755\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -110,7 +110,7 @@ esac\n if [ -z \"$SUBDIRECTORY_OK\" ]\n then\n \t: ${GIT_DIR=.git}\n-\tGIT_DIR=$(GIT_DIR=\"$GIT_DIR\" git rev-parse --git-dir) || {\n+\ttest -z \"$(git rev-parse --show-cdup)\" || {\n \t\texit=$?\n \t\techo >&2 \"You need to run this command from the toplevel of the working tree.\"\n \t\texit $exit\n-- \n1.5.3.rc4.3.gab089\n"}]}