git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] fsck: avoid looking at NULL blob->object

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 9, 2018, 08:38 UTC
Message-ID
<CAPig+cTgCD5=96XG=Z5FwOsPbN409DxzAfPy0p=wnoLywu++dw@mail.gmail.com>
In-Reply-To
<20180609083159.GA6158@sigill.intra.peff.net>
On Sat, Jun 9, 2018 at 4:32 AM, Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
> Commit 159e7b080b (fsck: detect gitmodules files,
> 2018-05-02) taught fsck to look at the content of
> .gitmodules files. If the object turns out not to be a blob
> at all, we just complain and punt on checking the content.
> And since this was such an obvious and trivial code path, I
> didn't even bother to add a test.
> [...]
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> diff --git a/t/t7415-submodule-names.sh b/t/t7415-submodule-names.sh
> @@ -151,4 +151,22 @@ 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 directly to avoid index restrictions.
Is there a word missing after "funny"?
Show 6 quoted lines
> +               mkdir subdir &&
> +               cp ../.gitmodules subdir/file &&
> +               git add subdir/file &&
> +               git commit -m ok &&
> +               tree=$(git ls-tree HEAD | sed s/subdir/.gitmodules/ | git mktree) &&
> +               commit=$(git commit-tree $tree) &&

I see that this is just mirroring the preceding test, but do you need to assign to variable 'commit' which is never consulted by anything later in the test?

> +               test_must_fail git fsck 2>output &&
> +               grep gitmodulesBlob output
> +       )
> +'
Previous: Jeff KingNext: Jeff King
Message 2 of 17 in “fsck: avoid looking at NULL blob->object”
  1. fsck: avoid looking at NULL blob->objectJeff King, Jun 9, 2018
  2. Eric SunshineJun 9, 2018
  3. Jeff KingJun 9, 2018
  4. Duy NguyenJun 9, 2018
  5. Jeff KingJun 9, 2018
  6. Martin ÅgrenJun 9, 2018
  7. Jeff KingJun 9, 2018
  8. Martin ÅgrenJun 9, 2018
  9. Jeff KingJun 12, 2018
  10. 0/2 .gitmodules fsck cleanupsJeff King, Jun 9, 2018
  11. 1/2 t7415: don't bother creating commit for symlink testJeff King, Jun 9, 2018
  12. SZEDER GáborJun 9, 2018
  13. 0/2 .gitmodules fsck cleanupsJeff King, Jun 11, 2018
  14. 1/2 t7415: don't bother creating commit for symlink testJeff King, Jun 11, 2018
  15. 2/2 fsck: avoid looking at NULL blob->objectJeff King, Jun 11, 2018
  16. 2/2 fsck: avoid looking at NULL blob->objectJeff King, Jun 9, 2018
  17. SZEDER GáborJun 9, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.