summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8718ed6)
raw | patch | inline | side by side (parent: 8718ed6)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Fri, 26 Nov 2010 15:32:03 +0000 (22:32 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 29 Nov 2010 21:25:54 +0000 (13:25 -0800) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1510-repo-setup.sh | patch | blob | history |
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index 0e379b5d454ca6d10e6fcbd375f106ba00f7ff52..1b4070a7e386d4b624d14e1f3d61a132e5ae095f 100755 (executable)
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
test_repo 3/sub/sub "$TRASH_DIRECTORY/3/.git" "$TRASH_DIRECTORY"
'
+#
+# case #4
+#
+############################################################
+#
+# Input:
+#
+# - GIT_WORK_TREE is not set
+# - GIT_DIR is not set
+# - core.worktree is set
+# - .git is a directory
+# - core.bare is not set, cwd is outside .git
+#
+# Output:
+#
+# core.worktree is ignored -> #0
+
+test_expect_success '#4: setup' '
+ unset GIT_DIR GIT_WORK_TREE &&
+ mkdir 4 4/sub &&
+ cd 4 &&
+ git init &&
+ git config core.worktree non-existent &&
+ cd ..
+'
+
+test_expect_failure '#4: at root' '
+ cat >4/expected <<EOF &&
+setup: git_dir: .git
+setup: worktree: $TRASH_DIRECTORY/4
+setup: cwd: $TRASH_DIRECTORY/4
+setup: prefix: (null)
+EOF
+ test_repo 4
+'
+
+test_expect_failure '#4: in subdir' '
+ cat >4/sub/expected <<EOF &&
+setup: git_dir: .git
+setup: worktree: $TRASH_DIRECTORY/4
+setup: cwd: $TRASH_DIRECTORY/4
+setup: prefix: sub/
+EOF
+ test_repo 4/sub
+'
+
test_done