From: Nguyễn Thái Ngọc Duy Date: Fri, 26 Nov 2010 15:32:02 +0000 (+0700) Subject: t1510: setup case #3 X-Git-Tag: v1.7.5.4~1^2~34 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8718ed61251ae1fd80a375a9f907edb2635a8a29 t1510: setup case #3 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 74750b8d4c..0e379b5d45 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -219,4 +219,271 @@ EOF test_repo 2/sub ../.git ' +# +# case #3 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is set +# - GIT_DIR is set +# - core.worktree is not set +# - .git is a directory +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# - worktree is set to $GIT_WORK_TREE +# - cwd is at worktree root +# - prefix is calculated +# - git_dir is set to $GIT_DIR +# - cwd can be outside worktree + +test_expect_success '#3: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 3 3/sub 3/sub/sub 3.wt 3.wt/sub 3/wt 3/wt/sub && + cd 3 && git init && cd .. +' + +test_expect_success '#3: GIT_DIR(rel), GIT_WORK_TREE=root at root' ' + cat >3/expected <3/expected <3/expected <3/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/expected <3/sub/sub/expected <3/expected <3/expected <3/expected <3/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <3/expected <3/expected <3/expected <3/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <