summaryrefslogtreecommitdiff
path: root/t/t7400-submodule-basic.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-05-01 05:14:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-01 05:14:44 (GMT)
commitd92dbf1934faad614c31482446d5f32fb9322470 (patch)
treef47557d9a01abea4b8a799854c0cc5551be11373 /t/t7400-submodule-basic.sh
parentb0f89870ea54b86fb7935f90605d329533849b33 (diff)
parent627fde102515a7807dba89acaa88cb053b38a44a (diff)
downloadgit-d92dbf1934faad614c31482446d5f32fb9322470.zip
git-d92dbf1934faad614c31482446d5f32fb9322470.tar.gz
git-d92dbf1934faad614c31482446d5f32fb9322470.tar.bz2
Merge branch 'jk/submodule-init-segv-fix'
Fix a segv in 'submodule init' when url is not given for a submodule. * jk/submodule-init-segv-fix: submodule_init: die cleanly on submodules without url defined
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index c2706fe..1b8f1db 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -38,6 +38,14 @@ test_expect_success 'submodule update aborts on missing .gitmodules file' '
test_i18ngrep "Submodule path .sub. not initialized" actual
'
+test_expect_success 'submodule update aborts on missing gitmodules url' '
+ test_when_finished "git update-index --remove sub" &&
+ git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
+ test_when_finished "rm -f .gitmodules" &&
+ git config -f .gitmodules submodule.s.path sub &&
+ test_must_fail git submodule init
+'
+
test_expect_success 'configuration parsing' '
test_when_finished "rm -f .gitmodules" &&
cat >.gitmodules <<-\EOF &&