Skip to content

Commit a2f509e

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

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

t/t1510-repo-setup.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4221,4 +4221,43 @@ EOF
42214221
test_repo 29/sub
42224222
'
42234223

4224+
#
4225+
# case #30
4226+
#
4227+
############################################################
4228+
#
4229+
# Input:
4230+
#
4231+
# - GIT_WORK_TREE is not set
4232+
# - GIT_DIR is set
4233+
# - core.worktree is set
4234+
# - .git is a file
4235+
# - core.bare is set
4236+
#
4237+
# Output:
4238+
#
4239+
# core.worktree and core.bare conflict, won't fly.
4240+
4241+
test_expect_success '#30: setup' '
4242+
unset GIT_DIR GIT_WORK_TREE &&
4243+
mkdir 30 &&
4244+
cd 30 &&
4245+
git init &&
4246+
git config core.bare true &&
4247+
git config core.worktree non-existent &&
4248+
mv .git ../30.git &&
4249+
echo gitdir: ../30.git >.git &&
4250+
cd ..
4251+
'
4252+
4253+
test_expect_failure '#30: at root' '
4254+
(
4255+
cd 30 &&
4256+
GIT_DIR=.git &&
4257+
export GIT_DIR &&
4258+
test_must_fail git symbolic-ref HEAD 2>result &&
4259+
grep "core.bare and core.worktree do not make sense" result
4260+
)
4261+
'
4262+
42244263
test_done

0 commit comments

Comments
 (0)