t7411: check configuration parsing errors
authorBrandon Williams <bmwill@google.com>
Tue, 25 Jul 2017 21:39:14 +0000 (14:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Aug 2017 21:35:08 +0000 (14:35 -0700)
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>
t/t7400-submodule-basic.sh
t/t7411-submodule-config.sh
index dcac364c5fa2a8ff7fe264a21fb9682ec934a874..717447526e1fe3b939fde19bd9b166b0807b7d04 100755 (executable)
@@ -46,16 +46,6 @@ test_expect_success 'submodule update aborts on missing gitmodules url' '
        test_must_fail git submodule init
 '
 
-test_expect_success 'configuration parsing' '
-       test_when_finished "rm -f .gitmodules" &&
-       cat >.gitmodules <<-\EOF &&
-       [submodule "s"]
-               path
-               ignore
-       EOF
-       test_must_fail git status
-'
-
 test_expect_success 'setup - repository in init subdirectory' '
        mkdir init &&
        (
index eea36f1dbe37859c5b45ca18bb3c8f1080ff3f9a..7d6b25ba230f0a991aa99bac437ea37e3434c4c1 100755 (executable)
@@ -31,6 +31,21 @@ test_expect_success 'submodule config cache setup' '
        )
 '
 
+test_expect_success 'configuration parsing with error' '
+       test_when_finished "rm -rf repo" &&
+       test_create_repo repo &&
+       cat >repo/.gitmodules <<-\EOF &&
+       [submodule "s"]
+               path
+               ignore
+       EOF
+       (
+               cd repo &&
+               test_must_fail test-submodule-config "" s 2>actual &&
+               test_i18ngrep "bad config" actual
+       )
+'
+
 cat >super/expect <<EOF
 Submodule name: 'a' for path 'a'
 Submodule name: 'a' for path 'b'