Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-07-14 02:52:49 +0300
committerJunio C Hamano <gitster@pobox.com>2021-07-14 02:52:49 +0300
commit5d96bcbc0602f96ccee3111ff93b05389cd6eae6 (patch)
tree242c2ce22d0e5a6d54ad3a25335466cf3580fde0 /builtin
parentd486ca60a51c9cb1fe068803c3f540724e95e83a (diff)
parentee02ac616435cb1da1e02c8b9c220649d3cec40a (diff)
Merge branch 'zh/cat-file-batch-fix'
"git cat-file --batch-all-objects"" misbehaved when "--batch" is in use and did not ask for certain object traits. * 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.c10
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.");