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

Re: [PATCH] t1010: add basic tests for mktree --batch

From
LBLaveesh Bansal <laveeshb@laveeshbansal.com>
Date
Nov 9, 2026, 23:12 UTC
Message-ID
<20261109231200.55724-1-laveeshb@laveeshbansal.com>
In-Reply-To
<pull.2270.git.1792497283164.gitgitgadget@gmail.com>
Roger Koranteng <rogerkorantenng@gmail.com> writes:
Show 7 quoted lines
> The only "mktree --batch" test in t1010 is the one checking that it
> survives a concurrent repack. Nothing covers basic batch mode, which
> is how the leak fixed in 6272f3bd17 (mktree: plug per-tree leak in
> --batch mode, 2026-08-29) went unnoticed.
>
> Add a few tests for it. Two trees in one batch should get the same
> [...]

Thanks for adding these. t1010 passes for me with the patch, also under SANITIZE=leak. With 6272f3bd17 reverted, tests 10, 11, 12 and 14 each fail when run on their own, so they do catch that leak.

> One test feeds two blank lines in a row and expects an empty tree in
> between. That is what mktree does today, but the documentation says
> trees are separated by "a single blank line", so I am not sure it is
> intended. The test records the current behaviour.

I would keep this test. The question about the documentation fits better below the "---" than in the commit message.

> +test_expect_success 'mktree --batch stops at a tree with a missing object' '
> [...]
> +	test_must_fail git mktree --batch <input >actual &&
> +	test_cmp tree actual

Capturing stderr and checking for the "is unavailable" message would make sure it died for the expected reason:

	test_must_fail git mktree --batch <input >actual 2>err &&
	test_cmp tree actual &&
	test_grep "object $missing is unavailable" err
Tested-by: Laveesh Bansal <laveeshb@laveeshbansal.com>
Previous: Roger Koranteng via GitGitGadgetNext: Roger Koranteng via GitGitGadget
Message 2 of 4 in “t1010: add basic tests for mktree --batch”
  1. t1010: add basic tests for mktree --batchRoger Koranteng via GitGitGadget, Oct 20, 2026
  2. Laveesh BansalNov 9, 2026
  3. t1010: add basic tests for mktree --batchRoger Koranteng via GitGitGadget, Nov 10, 2026
  4. Junio C HamanoNov 11, 2026

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.