diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-07-01 12:16:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-01 12:16:43 -0700 |
commit | bff9703f0a851d968a1ac60bc7cdc44e9a290652 (patch) | |
tree | 1f3e1524e0babbb012d3857aa0b8254ed8b2223b /builtin | |
parent | The second batch (diff) | |
parent | cat-file: merge two block into one (diff) | |
download | tgif-bff9703f0a851d968a1ac60bc7cdc44e9a290652.tar.xz |
Merge branch 'zh/cat-file-batch-fix' into zh/ref-filter-raw-data
* zh/cat-file-batch-fix:
cat-file: merge two block into one
cat-file: handle trivial --batch format with --batch-all-objects
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/cat-file.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 5ebf13359e..243fe6844b 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -512,12 +512,6 @@ static int batch_objects(struct batch_options *opt) if (opt->cmdmode) data.split_on_whitespace = 1; - if (opt->all_objects) { - struct object_info empty = OBJECT_INFO_INIT; - if (!memcmp(&data.info, &empty, sizeof(empty))) - data.skip_object_info = 1; - } - /* * If we are printing out the object, then always fill in the type, * since we will want to decide whether or not to stream. @@ -527,6 +521,10 @@ static int batch_objects(struct batch_options *opt) if (opt->all_objects) { struct object_cb_data cb; + struct object_info empty = OBJECT_INFO_INIT; + + if (!memcmp(&data.info, &empty, sizeof(empty))) + data.skip_object_info = 1; if (has_promisor_remote()) warning("This repository uses promisor remotes. Some objects may not be loaded."); |