From: Nguyễn Thái Ngọc Duy Date: Wed, 27 Oct 2010 14:49:27 GMT Subject: [PATCH 24/34] t1510: setup case #21 Message-ID: <1288190977-30875-25-git-send-email-pclouds@gmail.com> In-Reply-To: <1288190977-30875-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t1510-repo-setup.sh | 129 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 129 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index dc82736..8e3fffb 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -2946,4 +2946,133 @@ 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 && + export GIT_WORK_TREE=non-existent-too && + 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 <