Skip to content

Commit 818e393

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5c5b29b commit 818e393

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin/cat-file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,9 @@ static int batch_unordered_object(const struct object_id *oid, void *vdata)
470470
if (oidset_insert(data->seen, oid))
471471
return 0;
472472

473-
return batch_object_cb(oid, data);
473+
oidcpy(&data->expand->oid, oid);
474+
batch_object_write(NULL, data->scratch, data->opt, data->expand);
475+
return 0;
474476
}
475477

476478
static int batch_unordered_loose(const struct object_id *oid,

0 commit comments

Comments
 (0)