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:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-11-29 21:25:54 (GMT)
commit351fa1dc9fac3fc88895f30e6ef59e09ceb68bef (patch)
treeb293d19e4ad3ce13d6d3d140c3711f7854bf77c3 /t/t1510-repo-setup.sh
parent8718ed61251ae1fd80a375a9f907edb2635a8a29 (diff)
downloadgit-351fa1dc9fac3fc88895f30e6ef59e09ceb68bef.zip
git-351fa1dc9fac3fc88895f30e6ef59e09ceb68bef.tar.gz
git-351fa1dc9fac3fc88895f30e6ef59e09ceb68bef.tar.bz2
t1510: setup case #4
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.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index 0e379b5..1b4070a 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
@@ -486,4 +486,50 @@ EOF
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