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 15:32:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-11-29 21:25:59 (GMT)
commit2e8c6bab2e75b4965dea90663a9cbd5d4377a12f (patch)
tree8b7e170cc1baf182693c1a2d0edae217474e029b /t/t1510-repo-setup.sh
parent00bc13a9774610de0ea0952d0f011b14c18e52cb (diff)
downloadgit-2e8c6bab2e75b4965dea90663a9cbd5d4377a12f.zip
git-2e8c6bab2e75b4965dea90663a9cbd5d4377a12f.tar.gz
git-2e8c6bab2e75b4965dea90663a9cbd5d4377a12f.tar.bz2
t1510: setup case #28
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.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index f053a7d..d67733c 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
@@ -4122,4 +4122,53 @@ EOF
test_repo 27/sub/sub "$TRASH_DIRECTORY/27/.git" "$TRASH_DIRECTORY"
'
+#
+# case #28
+#
+############################################################
+#
+# Input:
+#
+# - GIT_WORK_TREE is not set
+# - GIT_DIR is not set
+# - core.worktree is set
+# - .git is a file
+# - core.bare is set
+#
+# Output:
+#
+# core.worktree is ignored -> #24
+
+test_expect_success '#28: setup' '
+ unset GIT_DIR GIT_WORK_TREE &&
+ mkdir 28 28/sub &&
+ cd 28 &&
+ git init &&
+ git config core.bare true &&
+ git config core.worktree non-existent &&
+ mv .git ../28.git &&
+ echo gitdir: ../28.git >.git &&
+ cd ..
+'
+
+test_expect_success '#28: at root' '
+ cat >28/expected <<EOF &&
+setup: git_dir: $TRASH_DIRECTORY/28.git
+setup: worktree: (null)
+setup: cwd: $TRASH_DIRECTORY/28
+setup: prefix: (null)
+EOF
+ test_repo 28
+'
+
+test_expect_success '#28: in subdir' '
+ cat >28/sub/expected <<EOF &&
+setup: git_dir: $TRASH_DIRECTORY/28.git
+setup: worktree: (null)
+setup: cwd: $TRASH_DIRECTORY/28/sub
+setup: prefix: (null)
+EOF
+ test_repo 28/sub
+'
+
test_done