Skip to content

Commit 239039b

Browse files
stefanbellergitster
authored andcommitted
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>
1 parent 7af55d1 commit 239039b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t/t7411-submodule-config.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,27 @@ test_expect_success 'reading of local configuration' '
140140
)
141141
'
142142

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+
143164
cat >super/expect_fetchrecurse_die.err <<EOF
144165
fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla
145166
EOF

0 commit comments

Comments
 (0)