diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 6f298a2b1a..fbab9c7e68 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -4260,4 +4260,273 @@ test_expect_failure '#30: at root' ' ) ' +# +# case #31 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is set +# - GIT_DIR is set +# - core.worktree is set +# - .git is a file +# - core.bare is set +# +# Output: +# +# #23 except git_dir is set according to .git file + +test_expect_success '#31: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 31 31/sub 31/sub/sub 31.wt 31.wt/sub 31/wt 31/wt/sub && + cd 31 && + git init && + git config core.bare true && + git config core.worktree non-existent && + mv .git ../31.git && + echo gitdir: ../31.git >.git && + cd .. +' + +test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=root at root' ' + cat >31/expected <31/expected <31/expected <31/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/expected <31/sub/sub/expected <31/expected <31/expected <31/expected <31/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <31/expected <31/expected <31/expected <31/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <