File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -3688,4 +3688,52 @@ EOF
36883688 test_repo 23/sub/sub "$TRASH_DIRECTORY/23/.git" "$TRASH_DIRECTORY"
36893689'
36903690
3691+ #
3692+ # case #24
3693+ #
3694+ # ###########################################################
3695+ #
3696+ # Input:
3697+ #
3698+ # - GIT_WORK_TREE is not set
3699+ # - GIT_DIR is not set
3700+ # - core.worktree is not set
3701+ # - .git is a file
3702+ # - core.bare is set
3703+ #
3704+ # Output:
3705+ #
3706+ # #16.2 except git_dir is set according to .git file
3707+
3708+ test_expect_success ' #24: setup' '
3709+ unset GIT_DIR GIT_WORK_TREE &&
3710+ mkdir 24 24/sub &&
3711+ cd 24 &&
3712+ git init &&
3713+ git config core.bare true &&
3714+ mv .git ../24.git &&
3715+ echo gitdir: ../24.git >.git &&
3716+ cd ..
3717+ '
3718+
3719+ test_expect_success ' #24: at root' '
3720+ cat >24/expected <<EOF &&
3721+ setup: git_dir: $TRASH_DIRECTORY/24.git
3722+ setup: worktree: (null)
3723+ setup: cwd: $TRASH_DIRECTORY/24
3724+ setup: prefix: (null)
3725+ EOF
3726+ test_repo 24
3727+ '
3728+
3729+ test_expect_success ' #24: in subdir' '
3730+ cat >24/sub/expected <<EOF &&
3731+ setup: git_dir: $TRASH_DIRECTORY/24.git
3732+ setup: worktree: (null)
3733+ setup: cwd: $TRASH_DIRECTORY/24/sub
3734+ setup: prefix: (null)
3735+ EOF
3736+ test_repo 24/sub
3737+ '
3738+
36913739test_done
You can’t perform that action at this time.
0 commit comments