summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc4045e)
raw | patch | inline | side by side (parent: fc4045e)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Fri, 26 Nov 2010 15:32:00 +0000 (22:32 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 29 Nov 2010 21:25:53 +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 26842274a22b7bd949de5f8d0090a2e6200bb5ee..9324d3ff6c513e743618c7ee964a7289e9a1ff4b 100755 (executable)
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
test_repo 0/sub
'
+#
+# case #1
+#
+############################################################
+#
+# Input:
+#
+# - GIT_WORK_TREE is set
+# - GIT_DIR is not set
+# - core.worktree is not set
+# - .git is a directory
+# - core.bare is not set, cwd is outside .git
+#
+# Output:
+#
+# GIT_WORK_TREE is ignored -> #0
+
+test_expect_success '#1: setup' '
+ unset GIT_DIR GIT_WORK_TREE &&
+ mkdir 1 1/sub 1.wt 1.wt/sub 1/wt 1/wt/sub &&
+ cd 1 &&
+ git init &&
+ GIT_WORK_TREE=non-existent &&
+ export GIT_WORK_TREE &&
+ cd ..
+'
+
+test_expect_failure '#1: at root' '
+ cat >1/expected <<EOF &&
+setup: git_dir: .git
+setup: worktree: $TRASH_DIRECTORY/1
+setup: cwd: $TRASH_DIRECTORY/1
+setup: prefix: (null)
+EOF
+ test_repo 1
+'
+
+test_expect_failure '#1: in subdir' '
+ cat >1/sub/expected <<EOF &&
+setup: git_dir: .git
+setup: worktree: $TRASH_DIRECTORY/1
+setup: cwd: $TRASH_DIRECTORY/1
+setup: prefix: sub/
+EOF
+ test_repo 1/sub
+'
+
test_done