Imported Upstream version 2.23.1
[platform/upstream/git.git] / t / t7415-submodule-names.sh
index 31d1e2d..905a557 100755 (executable)
@@ -154,7 +154,7 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
                # symlink detector; this grep string comes from the config
                # variable name and will not be translated.
                test_must_fail git fsck 2>output &&
-               grep gitmodulesSymlink output
+               test_i18ngrep gitmodulesSymlink output
        )
 '
 
@@ -172,7 +172,22 @@ test_expect_success 'fsck detects non-blob .gitmodules' '
                git ls-tree HEAD | sed s/subdir/.gitmodules/ | git mktree &&
 
                test_must_fail git fsck 2>output &&
-               grep gitmodulesBlob output
+               test_i18ngrep gitmodulesBlob output
+       )
+'
+
+test_expect_success 'fsck detects corrupt .gitmodules' '
+       git init corrupt &&
+       (
+               cd corrupt &&
+
+               echo "[broken" >.gitmodules &&
+               git add .gitmodules &&
+               git commit -m "broken gitmodules" &&
+
+               git fsck 2>output &&
+               test_i18ngrep gitmodulesParse output &&
+               test_i18ngrep ! "bad config" output
        )
 '