summaryrefslogtreecommitdiff
path: root/t/t1510-repo-setup.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-11-26 22:32:28 +0700
committerJunio C Hamano <gitster@pobox.com>2010-11-29 13:25:59 -0800
commit6ab5da1185e50051bcc375dfa3ad6f2de7054b2b (patch)
treea84d2ce8309ba94402326e4d02807ce0b95cb2d1 /t/t1510-repo-setup.sh
parent2e8c6bab2e75b4965dea90663a9cbd5d4377a12f (diff)
downloadgit-6ab5da1185e50051bcc375dfa3ad6f2de7054b2b.tar.gz
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>
Diffstat (limited to 't/t1510-repo-setup.sh')
-rwxr-xr-xt/t1510-repo-setup.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index d67733c896..f1b5ea530e 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
@@ -4171,4 +4171,54 @@ EOF
test_repo 28/sub
'
+#
+# case #29
+#
+############################################################
+#
+# Input:
+#
+# - GIT_WORK_TREE is set
+# - GIT_DIR is not set
+# - core.worktree is set
+# - .git is a file
+# - core.bare is set
+#
+# Output:
+#
+# GIT_WORK_TREE/core.worktree are ignored -> #28
+
+test_expect_success '#29: setup' '
+ unset GIT_DIR GIT_WORK_TREE &&
+ mkdir 29 29/sub &&
+ cd 29 &&
+ git init &&
+ git config core.bare true &&
+ GIT_WORK_TREE=non-existent &&
+ export GIT_WORK_TREE &&
+ mv .git ../29.git &&
+ echo gitdir: ../29.git >.git &&
+ cd ..
+'
+
+test_expect_failure '#29: at root' '
+ cat >29/expected <<EOF &&
+setup: git_dir: $TRASH_DIRECTORY/29.git
+setup: worktree: (null)
+setup: cwd: $TRASH_DIRECTORY/29
+setup: prefix: (null)
+EOF
+ test_repo 29
+'
+
+test_expect_failure '#29: in subdir' '
+ cat >29/sub/expected <<EOF &&
+setup: git_dir: $TRASH_DIRECTORY/29.git
+setup: worktree: (null)
+setup: cwd: $TRASH_DIRECTORY/29/sub
+setup: prefix: (null)
+EOF
+ test_repo 29/sub
+'
+
test_done