Thread (15 messages) flat view 15 messages, 3 authors, 2021-06-03
STALE1906d

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 2/2] [GSOC] cat-file: merge two block into one

From: ZheNing Hu via GitGitGadget <hidden>
Date: 2021-06-01 14:36:06
Subsystem: the rest · Maintainer: Linus Torvalds

From: ZheNing Hu <redacted>

 Because the two "if (opt->all_objects)" block
 are redundant, merge them into one, to provide
 better readability.

Helped-by: Jeff King [off-list ref]
Signed-off-by: ZheNing Hu <redacted>
---
 builtin/cat-file.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 02461bb5ea6f..243fe6844bc6 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.");
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help