t7411: check configuration parsing errors

Check for configuration parsing errors in '.gitmodules' in t7411, which is explicitly testing the submodule-config subsystem, instead of in t7400. Also explicitly use the test helper instead of relying on the gitmodules file from being read in status. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed Jul 25, 2017 at 14:39 UTC 5ea50954d0632342d38bd1a4d86c5aa601ef5207
2 files changed +15 -10
t/t7400-submodule-basic.sh
-10
@@ -46,16 +46,6 @@ test_expect_success 'submodule update aborts on missing gitmodules url' '
46 test_must_fail git submodule init
47 '
48
49 -test_expect_success 'configuration parsing' '
50 - test_when_finished "rm -f .gitmodules" &&
51 - cat >.gitmodules <<-\EOF &&
52 - [submodule "s"]
53 - path
54 - ignore
55 - EOF
56 - test_must_fail git status
57 -'
58 -
49 test_expect_success 'setup - repository in init subdirectory' '
50 mkdir init &&
51 (
t/t7411-submodule-config.sh
+15
@@ -31,6 +31,21 @@ test_expect_success 'submodule config cache setup' '
31 )
32 '
33
34 +test_expect_success 'configuration parsing with error' '
35 + test_when_finished "rm -rf repo" &&
36 + test_create_repo repo &&
37 + cat >repo/.gitmodules <<-\EOF &&
38 + [submodule "s"]
39 + path
40 + ignore
41 + EOF
42 + (
43 + cd repo &&
44 + test_must_fail test-submodule-config "" s 2>actual &&
45 + test_i18ngrep "bad config" actual
46 + )
47 +'
48 +
49 cat >super/expect <<EOF
50 Submodule name: 'a' for path 'a'
51 Submodule name: 'a' for path 'b'