From 555b96abdeb66c2f193219489c148a0169080c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 26 Nov 2010 22:32:05 +0700 Subject: [PATCH] t1510: setup case #6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t1510-repo-setup.sh | 291 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 291 insertions(+) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index f58d424f00..6e23c98322 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -580,4 +580,295 @@ EOF test_repo 5/sub ' +# +# case #6 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is 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 at $GIT_DIR +# - cwd can be outside worktree + +test_expect_success '#6: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 6 6/sub 6/sub/sub 6.wt 6.wt/sub 6/wt 6/wt/sub && + cd 6 && git init && cd .. +' + +test_expect_success '#6: GIT_DIR(rel), core.worktree=.. at root' ' + cat >6/expected <6/expected <6/expected <6/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/expected <6/sub/sub/expected <6/expected <6/expected <6/expected <6/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <6/expected <6/expected <6/expected <6/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <