summaryrefslogtreecommitdiff
path: root/builtin/cat-file.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-10-05 20:36:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-08 22:45:14 (GMT)
commit818e393084351324501b90142f7e8f95997db62b (patch)
treebfd1e85da43a20cc5fca9c6082026c6ed74ccc67 /builtin/cat-file.c
parent5c5b29b459dd6e169c9114910adca9203532f7d7 (diff)
downloadgit-818e393084351324501b90142f7e8f95997db62b.zip
git-818e393084351324501b90142f7e8f95997db62b.tar.gz
git-818e393084351324501b90142f7e8f95997db62b.tar.bz2
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>
Diffstat (limited to 'builtin/cat-file.c')
-rw-r--r--builtin/cat-file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index b713be5..b533935 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -470,7 +470,9 @@ static int batch_unordered_object(const struct object_id *oid, void *vdata)
if (oidset_insert(data->seen, oid))
return 0;
- return batch_object_cb(oid, data);
+ oidcpy(&data->expand->oid, oid);
+ batch_object_write(NULL, data->scratch, data->opt, data->expand);
+ return 0;
}
static int batch_unordered_loose(const struct object_id *oid,