builtin/submodule--helper: remove debugging leftover tracing
[gitweb.git] / t / t7415-submodule-names.sh
index 4157e1a134e15678e8b271a036230ad6a8ffc257..293e2e1963962e49afa10882439b5106607439a1 100755 (executable)
@@ -145,13 +145,10 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
                tricky="[foo]bar=true" &&
                content=$(git hash-object -w ../.gitmodules) &&
                target=$(printf "$tricky" | git hash-object -w --stdin) &&
-               tree=$(
-                       {
-                               printf "100644 blob $content\t$tricky\n" &&
-                               printf "120000 blob $target\t.gitmodules\n"
-                       } | git mktree
-               ) &&
-               commit=$(git commit-tree $tree) &&
+               {
+                       printf "100644 blob $content\t$tricky\n" &&
+                       printf "120000 blob $target\t.gitmodules\n"
+               } | git mktree &&
 
                # Check not only that we fail, but that it is due to the
                # symlink detector; this grep string comes from the config
@@ -161,4 +158,37 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
        )
 '
 
+test_expect_success 'fsck detects non-blob .gitmodules' '
+       git init non-blob &&
+       (
+               cd non-blob &&
+
+               # As above, make the funny tree directly to avoid index
+               # restrictions.
+               mkdir subdir &&
+               cp ../.gitmodules subdir/file &&
+               git add subdir/file &&
+               git commit -m ok &&
+               git ls-tree HEAD | sed s/subdir/.gitmodules/ | git mktree &&
+
+               test_must_fail git fsck 2>output &&
+               grep 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 &&
+               grep gitmodulesParse output &&
+               test_i18ngrep ! "bad config" output
+       )
+'
+
 test_done