From: Nguyễn Thái Ngọc Duy Date: Sun, 24 Oct 2010 12:11:39 GMT Subject: [WIP PATCH 07/18] t1510: setup case #4 Message-ID: <1287922310-14678-8-git-send-email-pclouds@gmail.com> In-Reply-To: <1287922310-14678-1-git-send-email-pclouds@gmail.com> --- t/t1510-repo-setup.sh | 131 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 131 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 508b7e2..ee2b02a 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -457,4 +457,135 @@ EOF GIT_DIR="$TRASH_DIRECTORY/3/.git" GIT_WORK_TREE="$TRASH_DIRECTORY" test_repo 3/sub/sub ' +# +# case #4 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is not set +# - core.worktree is set +# - .git is a directory +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# - 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 '#4: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 4 4/sub 4/sub/sub 4.wt 4.wt/sub 4/wt 4/wt/sub && + cd 4 && git init && cd .. +' + +test_expect_success '#4: core.worktree(rel), at root' ' + cat >4/expected <4/expected <4/sub/sub/expected <4/sub/sub/expected <4/expected <4/expected <4/sub/sub/expected <4/sub/sub/expected <4/expected <4/expected <