Thread (75 messages) flat view 75 messages, 5 authors, 12h ago

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

From: Patrick Steinhardt <hidden>
Date: 2026-09-03 10:03:48

On Thu, Sep 03, 2026 at 11:27:59AM +0200, Karthik Nayak wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help