From: Nguyễn Thái Ngọc Duy Date: Fri, 26 Nov 2010 15:32:20 +0000 (+0700) Subject: t1510: setup case #21 X-Git-Tag: v1.7.4-rc0~4^2~23 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=21b3466f59847165a5f58208e94b832b448e5cb6;p=git.git t1510: setup case #21 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 8e649e0f0..1d01a6c8e 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -2954,4 +2954,134 @@ EOF test_repo 20/sub ' +# +# case #21.1 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is set +# - GIT_DIR is not set +# - core.worktree is set +# - .git is a directory +# - cwd is inside .git +# +# Output: +# +# GIT_WORK_TREE/core.worktree are ignored -> #20.1 + +test_expect_success '#21.1: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 21 21/sub && + cd 21 && + git init && + git config core.worktree non-existent && + GIT_WORK_TREE=non-existent-too && + export GIT_WORK_TREE && + mkdir .git/wt .git/wt/sub && + cd .. +' + +test_expect_failure '#21.1: at .git' ' + cat >21/.git/expected <21/.git/wt/expected <21/.git/wt/sub/expected < #20.2 + +test_expect_success '#21.2: setup' ' + git config --file="$TRASH_DIRECTORY/21/.git/config" core.bare true +' + +test_expect_failure '#21.2: at .git' ' + cat >21/.git/expected <21/.git/wt/expected <21/.git/wt/sub/expected <21/expected <21/sub/expected <