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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




On Thu, Sep 03, 2026 at 11:27:59AM +0200, Karthik Nayak wrote:
> 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

[Index of Archives] [Linux Kernel Development] [Gcc Help] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [V4L] [Bugtraq] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [Fedora Users]

(追記) (追記ここまで)
Powered by Linux

AltStyle によって変換されたページ (->オリジナル) /