Imported Upstream version 2.20.2
[platform/upstream/git.git] / t / t7415-submodule-names.sh
index 31d1e2d..140ea8c 100755 (executable)
@@ -176,6 +176,21 @@ test_expect_success 'fsck detects non-blob .gitmodules' '
        )
 '
 
+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 &&
+               grep gitmodulesParse output &&
+               test_i18ngrep ! "bad config" output
+       )
+'
+
 test_expect_success MINGW 'prevent git~1 squatting on Windows' '
        git init squatting &&
        (
@@ -229,7 +244,7 @@ test_expect_success 'git dirs of sibling submodules must not be nested' '
                git commit -m nested
        ) &&
        test_must_fail git clone --recurse-submodules nested clone 2>err &&
-       test_i18ngrep "is inside git dir" err
+       test_i18ngrep -E "(is inside git dir|hippo already exists|not a git repository: .*/hippo)" err
 '
 
 test_done