t1510: setup case #30
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Nov 26, 2010 at 22:32 UTC
a2f509e1d8d8103a719fd6784e859c0af8c1adf5
1 file changed
+39
t/t1510-repo-setup.sh
+39
@@ -4221,4 +4221,43 @@ EOF
4221
test_repo 29/sub
4222
'
4223
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
+
4263
test_done