Skip to content

t1010: add basic tests for mktree --batch - #2270

Open
rogerkorantenng wants to merge 1 commit into
gitgitgadget:masterfrom
rogerkorantenng:mktree-batch-tests
Open

rogerkorantenng wants to merge 1 commit into
gitgitgadget:masterfrom
rogerkorantenng:mktree-batch-tests

Conversation

@rogerkorantenng

Copy link
Copy Markdown

CC: Jeff King peff@peff.net, Elijah Newren newren@gmail.com, Patrick Steinhardt ps@pks.im, Junio C Hamano gitster@pobox.com, Kaartic Sivaraam kaartic.sivaraam@gmail.com, Christian Couder christian.couder@gmail.com, Siddharth Asthana siddharthasthana31@gmail.com, Usman Akinyemi usmanakinyemi202@gmail.com

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 6272f3b (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
IDs as running plain "mktree" on each, a trailing blank line should
not add an extra tree, -z input should work, and a tree that names a
missing object should make mktree die after printing the trees before
it. While at it, check that a blank line is rejected without --batch.

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.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Roger Koranteng <rogerkorantenng@gmail.com>
@rogerkorantenng

Copy link
Copy Markdown
Author

/preview

@gitgitgadget

gitgitgadget Bot commented Oct 20, 2026

Copy link
Copy Markdown

Preview email sent as pull.2270.git.1792497205893.gitgitgadget@gmail.com

@rogerkorantenng

Copy link
Copy Markdown
Author

/submit

@gitgitgadget

gitgitgadget Bot commented Oct 20, 2026

Copy link
Copy Markdown

Submitted as pull.2270.git.1792497283164.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2270/rogerkorantenng/mktree-batch-tests-v1

To fetch this version to local tag pr-2270/rogerkorantenng/mktree-batch-tests-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2270/rogerkorantenng/mktree-batch-tests-v1

@gitgitgadget

gitgitgadget Bot commented Oct 21, 2026

Copy link
Copy Markdown

This branch is now known as rk/mktree-batch-tests.

@gitgitgadget

gitgitgadget Bot commented Oct 21, 2026

Copy link
Copy Markdown

This patch series was integrated into seen via git@77e6f5f.

@gitgitgadget gitgitgadget Bot added the seen label Oct 21, 2026
@gitgitgadget

gitgitgadget Bot commented Oct 22, 2026

Copy link
Copy Markdown

There was a status update in the "New Topics" section about the branch rk/mktree-batch-tests on the Git mailing list:

Basic tests for the batch mode of 'git mktree' have been added.

Needs review.
source: <pull.2270.git.1792497283164.gitgitgadget@gmail.com>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant