Skip to content

Commit

Permalink
git-sh-setup.sh: use "git rev-parse --show-cdup" to check for SUBDIRE…
Browse files Browse the repository at this point in the history
…CTORY_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>
  • Loading branch information
pclouds authored and gitster committed Oct 30, 2007
1 parent 09149c7 commit 6b9ff1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-sh-setup.sh
Expand Up @@ -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
Expand Down

0 comments on commit 6b9ff1e

Please sign in to comment.