File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4171,4 +4171,54 @@ EOF
41714171 test_repo 28/sub
41724172'
41734173
4174+ #
4175+ # case #29
4176+ #
4177+ # ###########################################################
4178+ #
4179+ # Input:
4180+ #
4181+ # - GIT_WORK_TREE is set
4182+ # - GIT_DIR is not set
4183+ # - core.worktree is set
4184+ # - .git is a file
4185+ # - core.bare is set
4186+ #
4187+ # Output:
4188+ #
4189+ # GIT_WORK_TREE/core.worktree are ignored -> #28
4190+
4191+ test_expect_success ' #29: setup' '
4192+ unset GIT_DIR GIT_WORK_TREE &&
4193+ mkdir 29 29/sub &&
4194+ cd 29 &&
4195+ git init &&
4196+ git config core.bare true &&
4197+ GIT_WORK_TREE=non-existent &&
4198+ export GIT_WORK_TREE &&
4199+ mv .git ../29.git &&
4200+ echo gitdir: ../29.git >.git &&
4201+ cd ..
4202+ '
4203+
4204+ test_expect_failure ' #29: at root' '
4205+ cat >29/expected <<EOF &&
4206+ setup: git_dir: $TRASH_DIRECTORY/29.git
4207+ setup: worktree: (null)
4208+ setup: cwd: $TRASH_DIRECTORY/29
4209+ setup: prefix: (null)
4210+ EOF
4211+ test_repo 29
4212+ '
4213+
4214+ test_expect_failure ' #29: in subdir' '
4215+ cat >29/sub/expected <<EOF &&
4216+ setup: git_dir: $TRASH_DIRECTORY/29.git
4217+ setup: worktree: (null)
4218+ setup: cwd: $TRASH_DIRECTORY/29/sub
4219+ setup: prefix: (null)
4220+ EOF
4221+ test_repo 29/sub
4222+ '
4223+
41744224test_done
You can’t perform that action at this time.
0 commit comments