Thread (98 messages) flat view 98 messages, 7 authors, 7d ago

Re: [PATCH v6 2/4] receive-pack: drop static variables to track report status version

From: Karthik Nayak <hidden>
Date: 2026-09-03 16:31:25

Patrick Steinhardt [off-list ref] writes:
On Thu, Sep 03, 2026 at 11:27:59AM +0200, Karthik Nayak wrote:
quoted
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 86933d8d7e..a9a3d21c24 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2716,10 +2722,12 @@ int cmd_receive_pack(int argc,
 				 &push_options);
 		delete_tempfile(&pack_lockfile);
 		sigchain_push(SIGPIPE, SIG_IGN);
-		if (report_status_v2)
+		if (version == REPORT_STATUS_V2)
 			report_v2(commands, unpack_status);
-		else if (report_status)
+		else if (version == REPORT_STATUS_V0)
 			report(commands, unpack_status);
+		else
+			BUG("unknown report status version");
Nit: I typically prefer switches when we want to handle enums, even
though they are more verbose. Please feel free to ignore though, this is
highly subjective and it's not worth a reroll.

Patrick
I'll add it in, and it'll be part of the reroll (if necessary).

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help