submodule helper: convert relative URL to absolute URL if needed
[gitweb.git] / t / t7400-submodule-basic.sh
index 7d3d9842108ae5961f7c17e392f0ce9a8b397cf4..76a7cb0af7955aa618556a43cc9f2a568d8de3e8 100755 (executable)
@@ -984,11 +984,6 @@ test_expect_success 'submodule deinit should remove the whole submodule section
        rmdir init
 '
 
-test_expect_success 'submodule deinit should unset core.worktree' '
-       test_path_is_file .git/modules/example/config &&
-       test_must_fail git config -f .git/modules/example/config core.worktree
-'
-
 test_expect_success 'submodule deinit from subdirectory' '
        git submodule update --init &&
        git config submodule.example.foo bar &&
@@ -1229,6 +1224,30 @@ test_expect_success 'submodule update and setting submodule.<name>.active' '
        test_cmp expect actual
 '
 
+test_expect_success 'clone active submodule without submodule url set' '
+       test_when_finished "rm -rf test/test" &&
+       mkdir test &&
+       # another dir breaks accidental relative paths still being correct
+       git clone file://"$pwd"/multisuper test/test &&
+       (
+               cd test/test &&
+               git config submodule.active "." &&
+
+               # do not pass --init flag, as the submodule is already active:
+               git submodule update &&
+               git submodule status >actual_raw &&
+
+               cut -c 1,43- actual_raw >actual &&
+               cat >expect <<-\EOF &&
+                sub0 (test2)
+                sub1 (test2)
+                sub2 (test2)
+                sub3 (test2)
+               EOF
+               test_cmp expect actual
+       )
+'
+
 test_expect_success 'clone --recurse-submodules with a pathspec works' '
        test_when_finished "rm -rf multisuper_clone" &&
        cat >expected <<-\EOF &&