X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1510-repo-setup.sh;h=8d4ef4cd1f6cf2f41cef10213abc6f18b1a68ed8;hb=cf83243b0b8a8c444c03b37286b4498ec78f5666;hp=2596f7ff75b30668a7f2942bf2b16880360bce17;hpb=af62cc1ba686dd94f5c0ca4181db00e1b8519af8;p=git.git diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 2596f7ff7..8d4ef4cd1 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -2360,4 +2360,133 @@ EOF test_repo 16/sub ' +# +# case #17.1 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is set +# - GIT_DIR is not set +# - core.worktree is not set +# - .git is a directory +# - cwd is inside .git +# +# Output: +# +# GIT_WORK_TREE is ignored -> #16.1 (with warnings perhaps) + +test_expect_success '#17.1: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 17 17/sub && + cd 17 && + git init && + mkdir .git/wt .git/wt/sub && + GIT_WORK_TREE=non-existent && + export GIT_WORK_TREE && + cd .. +' + +test_expect_failure '#17.1: at .git' ' + cat >17/.git/expected <17/.git/wt/expected <17/.git/wt/sub/expected < #16.2 (with warnings perhaps) + +test_expect_success '#17.2: setup' ' + git config --file="$TRASH_DIRECTORY/17/.git/config" core.bare true +' + +test_expect_failure '#17.2: at .git' ' + cat >17/.git/expected <17/.git/wt/expected <17/.git/wt/sub/expected <17/expected <17/sub/expected <