t7411: test lookup of uninitialized submodules

Sometimes we need to lookup information of uninitialized submodules. Make sure that works. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Dec 27, 2016 at 11:36 UTC 239039bd703e9f2286699de5aedae4c17defbbf1
1 file changed +21
t/t7411-submodule-config.sh
+21
@@ -140,6 +140,27 @@ test_expect_success 'reading of local configuration' '
140 )
141 '
142
143 +cat >super/expect_url <<EOF
144 +Submodule url: '../submodule' for path 'b'
145 +Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule'
146 +EOF
147 +
148 +test_expect_success 'reading of local configuration for uninitialized submodules' '
149 + (
150 + cd super &&
151 + git submodule deinit -f b &&
152 + old_submodule=$(git config submodule.submodule.url) &&
153 + git config submodule.submodule.url git@somewhere.else.net:submodule.git &&
154 + test-submodule-config --url \
155 + "" b \
156 + "" submodule \
157 + >actual &&
158 + test_cmp expect_url actual &&
159 + git config submodule.submodule.url "$old_submodule" &&
160 + git submodule init b
161 + )
162 +'
163 +
164 cat >super/expect_fetchrecurse_die.err <<EOF
165 fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla
166 EOF