do_for_each_reflog(): use a strbuf to hold logfile name
[gitweb.git] / t / t7400-submodule-basic.sh
index 695f7afdf31cc589e9c31d764d1e713ad64240c0..81827e696f21f598357313d6dad94400d8562718 100755 (executable)
@@ -79,6 +79,15 @@ test_expect_success 'submodule add' '
                cd addtest &&
                git submodule add -q "$submodurl" submod >actual &&
                test ! -s actual &&
+               echo "gitdir: ../.git/modules/submod" >expect &&
+               test_cmp expect submod/.git &&
+               (
+                       cd submod &&
+                       git config core.worktree >actual &&
+                       echo "../../../submod" >expect &&
+                       test_cmp expect actual &&
+                       rm -f actual expect
+               ) &&
                git submodule init
        ) &&
 
@@ -225,7 +234,7 @@ EOF
 
 test_expect_success 'status should only print one line' '
        git submodule status >lines &&
-       test $(wc -l <lines) = 1
+       test_line_count = 1 lines
 '
 
 test_expect_success 'setup - fetch commit name from submodule' '
@@ -498,4 +507,17 @@ test_expect_success 'relative path works with user@host:path' '
        )
 '
 
+test_expect_success 'moving the superproject does not break submodules' '
+       (
+               cd addtest &&
+               git submodule status >expect
+       )
+       mv addtest addtest2 &&
+       (
+               cd addtest2 &&
+               git submodule status >actual &&
+               test_cmp expect actual
+       )
+'
+
 test_done