Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-11-26 18:32:23 +0300
committerJunio C Hamano <gitster@pobox.com>2010-11-30 00:25:58 +0300
commit73a509ce44f94ad9a50126ab04490bce926feb8e (patch)
tree5db6565dfa36e7b1223f66dad14c2824f26ec7c6 /t/t1510-repo-setup.sh
parent5362cbfcf3b8939edc4bd0058d6b8b08d4621234 (diff)
t1510: setup case #24
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.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index ad27d1278b..79959f6dc5 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
@@ -3688,4 +3688,52 @@ EOF
test_repo 23/sub/sub "$TRASH_DIRECTORY/23/.git" "$TRASH_DIRECTORY"
'
+#
+# case #24
+#
+############################################################
+#
+# Input:
+#
+# - GIT_WORK_TREE is not set
+# - GIT_DIR is not set
+# - core.worktree is not set
+# - .git is a file
+# - core.bare is set
+#
+# Output:
+#
+# #16.2 except git_dir is set according to .git file
+
+test_expect_success '#24: setup' '
+ unset GIT_DIR GIT_WORK_TREE &&
+ mkdir 24 24/sub &&
+ cd 24 &&
+ git init &&
+ git config core.bare true &&
+ mv .git ../24.git &&
+ echo gitdir: ../24.git >.git &&
+ cd ..
+'
+
+test_expect_success '#24: at root' '
+ cat >24/expected <<EOF &&
+setup: git_dir: $TRASH_DIRECTORY/24.git
+setup: worktree: (null)
+setup: cwd: $TRASH_DIRECTORY/24
+setup: prefix: (null)
+EOF
+ test_repo 24
+'
+
+test_expect_success '#24: in subdir' '
+ cat >24/sub/expected <<EOF &&
+setup: git_dir: $TRASH_DIRECTORY/24.git
+setup: worktree: (null)
+setup: cwd: $TRASH_DIRECTORY/24/sub
+setup: prefix: (null)
+EOF
+ test_repo 24/sub
+'
+
test_done