mirror of
https://github.com/git/git.git
synced 2025-01-11 01:54:06 +08:00
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>
This commit is contained in:
parent
5c5b29b459
commit
818e393084
@ -470,7 +470,9 @@ static int batch_unordered_object(const struct object_id *oid, void *vdata)
|
|||||||
if (oidset_insert(data->seen, oid))
|
if (oidset_insert(data->seen, oid))
|
||||||
return 0;
|
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,
|
static int batch_unordered_loose(const struct object_id *oid,
|
||||||
|
Loading…
Reference in New Issue
Block a user