From: Nguyễn Thái Ngọc Duy Date: Sun, 24 Oct 2010 12:11:40 GMT Subject: [WIP PATCH 08/18] t1510: setup case #5 Message-ID: <1287922310-14678-9-git-send-email-pclouds@gmail.com> In-Reply-To: <1287922310-14678-1-git-send-email-pclouds@gmail.com> --- t/t1510-repo-setup.sh | 135 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 135 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index ee2b02a..87db2c6 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -588,4 +588,139 @@ EOF test_repo 4 ' +# +# case #5 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is set +# - GIT_DIR is not set +# - core.worktree is set +# - .git is a directory +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# GIT_WORK_TREE is only effective when GIT_DIR is +# set, which is not the case. So it is the same as case #4. +# +# - worktree is at core.worktree +# - cwd is at worktree root +# - prefix is calculated +# - git_dir is discovered +# - cwd can be outside worktree + +test_expect_success '#5: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 5 5/sub 5/sub/sub 5.wt 5.wt/sub 5/wt 5/wt/sub && + cd 5 && git init && cd .. && + export GIT_WORK_TREE=non-existent +' + +test_expect_failure '#5: core.worktree(rel), at root' ' + cat >5/expected <5/expected <5/sub/sub/expected <5/sub/sub/expected <5/expected <5/expected <5/sub/sub/expected <5/sub/sub/expected <5/expected <5/expected <