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>
Nguyễn Thái Ngọc Duy committed
Nov 26, 2010 at 22:32 UTC
73a509ce44f94ad9a50126ab04490bce926feb8e
1 file changed
+48
t/t1510-repo-setup.sh
+48
@@ -3688,4 +3688,52 @@ EOF
3688
test_repo 23/sub/sub "$TRASH_DIRECTORY/23/.git" "$TRASH_DIRECTORY"
3689
'
3690
3691
+#
3692
+# case #24
3693
+#
3694
+############################################################
3695
+#
3696
+# Input:
3697
+#
3698
+# - GIT_WORK_TREE is not set
3699
+# - GIT_DIR is not set
3700
+# - core.worktree is not set
3701
+# - .git is a file
3702
+# - core.bare is set
3703
+#
3704
+# Output:
3705
+#
3706
+# #16.2 except git_dir is set according to .git file
3707
+
3708
+test_expect_success '#24: setup' '
3709
+ unset GIT_DIR GIT_WORK_TREE &&
3710
+ mkdir 24 24/sub &&
3711
+ cd 24 &&
3712
+ git init &&
3713
+ git config core.bare true &&
3714
+ mv .git ../24.git &&
3715
+ echo gitdir: ../24.git >.git &&
3716
+ cd ..
3717
+'
3718
+
3719
+test_expect_success '#24: at root' '
3720
+ cat >24/expected <<EOF &&
3721
+setup: git_dir: $TRASH_DIRECTORY/24.git
3722
+setup: worktree: (null)
3723
+setup: cwd: $TRASH_DIRECTORY/24
3724
+setup: prefix: (null)
3725
+EOF
3726
+ test_repo 24
3727
+'
3728
+
3729
+test_expect_success '#24: in subdir' '
3730
+ cat >24/sub/expected <<EOF &&
3731
+setup: git_dir: $TRASH_DIRECTORY/24.git
3732
+setup: worktree: (null)
3733
+setup: cwd: $TRASH_DIRECTORY/24/sub
3734
+setup: prefix: (null)
3735
+EOF
3736
+ test_repo 24/sub
3737
+'
3738
+
3739
test_done