t1510: setup case #29
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
6ab5da1185e50051bcc375dfa3ad6f2de7054b2b
1 file changed
+50
t/t1510-repo-setup.sh
+50
@@ -4171,4 +4171,54 @@ EOF
4171
test_repo 28/sub
4172
'
4173
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
+
4224
test_done