completion: ensure that the repository path given on the command line exists
[gitweb.git] / t / t7411-submodule-config.sh
index d389ae5408ab783467f64368adc01325e258046b..eea36f1dbe37859c5b45ca18bb3c8f1080ff3f9a 100755 (executable)
@@ -134,12 +134,33 @@ test_expect_success 'reading of local configuration' '
                        "" submodule \
                                >actual &&
                test_cmp expect_local_path actual &&
-               git config submodule.a.url $old_a &&
-               git config submodule.submodule.url $old_submodule &&
+               git config submodule.a.url "$old_a" &&
+               git config submodule.submodule.url "$old_submodule" &&
                git config --unset submodule.a.path c
        )
 '
 
+cat >super/expect_url <<EOF
+Submodule url: '../submodule' for path 'b'
+Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule'
+EOF
+
+test_expect_success 'reading of local configuration for uninitialized submodules' '
+       (
+               cd super &&
+               git submodule deinit -f b &&
+               old_submodule=$(git config submodule.submodule.url) &&
+               git config submodule.submodule.url git@somewhere.else.net:submodule.git &&
+               test-submodule-config --url \
+                       "" b \
+                       "" submodule \
+                               >actual &&
+               test_cmp expect_url actual &&
+               git config submodule.submodule.url "$old_submodule" &&
+               git submodule init b
+       )
+'
+
 cat >super/expect_fetchrecurse_die.err <<EOF
 fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla
 EOF