]> git.ipfire.org Git - thirdparty/git.git/commit
cat-file: split ordered/unordered batch-all-objects callbacks
authorJeff King <peff@peff.net>
Tue, 5 Oct 2021 20:36:17 +0000 (16:36 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Oct 2021 22:45:14 +0000 (15:45 -0700)
commit818e393084351324501b90142f7e8f95997db62b
treebfd1e85da43a20cc5fca9c6082026c6ed74ccc67
parent5c5b29b459dd6e169c9114910adca9203532f7d7
cat-file: split ordered/unordered batch-all-objects callbacks

When we originally added --batch-all-objects, it stuffed everything into
an oid_array(), and then iterated over that array with a callback to
write the actual output.

When we later added --unordered, that code path writes immediately as we
discover each object, but just calls the same batch_object_cb() as our
entry point to the writing code. That callback has a narrow interface;
it only receives the oid, but we know much more about each object in the
unordered write (which we'll make use of in the next patch). So let's
just call batch_object_write() directly. The callback wasn't saving us
much effort.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/cat-file.c