Skip to content

Commit 2e8c6ba

Browse files
pcloudsgitster
authored andcommitted
t1510: setup case #28
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 00bc13a commit 2e8c6ba

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

t/t1510-repo-setup.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4122,4 +4122,53 @@ EOF
41224122
test_repo 27/sub/sub "$TRASH_DIRECTORY/27/.git" "$TRASH_DIRECTORY"
41234123
'
41244124

4125+
#
4126+
# case #28
4127+
#
4128+
############################################################
4129+
#
4130+
# Input:
4131+
#
4132+
# - GIT_WORK_TREE is not set
4133+
# - GIT_DIR is not set
4134+
# - core.worktree is set
4135+
# - .git is a file
4136+
# - core.bare is set
4137+
#
4138+
# Output:
4139+
#
4140+
# core.worktree is ignored -> #24
4141+
4142+
test_expect_success '#28: setup' '
4143+
unset GIT_DIR GIT_WORK_TREE &&
4144+
mkdir 28 28/sub &&
4145+
cd 28 &&
4146+
git init &&
4147+
git config core.bare true &&
4148+
git config core.worktree non-existent &&
4149+
mv .git ../28.git &&
4150+
echo gitdir: ../28.git >.git &&
4151+
cd ..
4152+
'
4153+
4154+
test_expect_success '#28: at root' '
4155+
cat >28/expected <<EOF &&
4156+
setup: git_dir: $TRASH_DIRECTORY/28.git
4157+
setup: worktree: (null)
4158+
setup: cwd: $TRASH_DIRECTORY/28
4159+
setup: prefix: (null)
4160+
EOF
4161+
test_repo 28
4162+
'
4163+
4164+
test_expect_success '#28: in subdir' '
4165+
cat >28/sub/expected <<EOF &&
4166+
setup: git_dir: $TRASH_DIRECTORY/28.git
4167+
setup: worktree: (null)
4168+
setup: cwd: $TRASH_DIRECTORY/28/sub
4169+
setup: prefix: (null)
4170+
EOF
4171+
test_repo 28/sub
4172+
'
4173+
41254174
test_done

0 commit comments

Comments
 (0)