diff options
author | ZheNing Hu <adlternative@gmail.com> | 2021-06-03 16:29:26 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-06-04 07:50:26 +0900 |
commit | ee02ac616435cb1da1e02c8b9c220649d3cec40a (patch) | |
tree | 0e728fee80bd09b680052288602a72db7bbff57f | |
parent | cat-file: handle trivial --batch format with --batch-all-objects (diff) | |
download | tgif-ee02ac616435cb1da1e02c8b9c220649d3cec40a.tar.xz |
cat-file: merge two block into one
There are two "if (opt->all_objects)" blocks next
to each other, merge them into one to provide better
readability.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: ZheNing Hu <adlternative@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin/cat-file.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 02461bb5ea..243fe6844b 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -520,14 +520,11 @@ static int batch_objects(struct batch_options *opt) data.info.typep = &data.type; 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 (opt->all_objects) { - struct object_cb_data cb; if (has_promisor_remote()) warning("This repository uses promisor remotes. Some objects may not be loaded."); |