Re: [PATCH v6 3/4] receive-pack: move message generation to separate function
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 3, 2026, 10:03 UTC
- Message-ID
- <aplF-zxlGRqZs6tf@pks.im>
- In-Reply-To
- <20260903-758-introduce-hook-v6-3-6283b1fb9b1c@gmail.com>
On Thu, Sep 03, 2026 at 11:28:00AM +0200, Karthik Nayak wrote:
Show 5 quoted lines
> diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c > index a9a3d21c24..9ac10465ac 100644 > --- a/builtin/receive-pack.c > +++ b/builtin/receive-pack.c > @@ -2535,67 +2535,72 @@ static void update_shallow_info(struct command *commands,
[snip]
Show 21 quoted lines
> +static void report(struct command *commands, const char *unpack_status)
> +{
> + struct strbuf buf = STRBUF_INIT;
> +
> + generate_report(&buf, commands, unpack_status, REPORT_STATUS_V0);
> +
> + if (use_sideband)
> + send_sideband(1, 1, buf.buf, buf.len, use_sideband);
> + else
> + write_or_die(1, buf.buf, buf.len);
> + strbuf_release(&buf);
> +}
> +
> +static void report_v2(struct command *commands, const char *unpack_status)
> +{
> + struct strbuf buf = STRBUF_INIT;
> +
> + generate_report(&buf, commands, unpack_status, REPORT_STATUS_V2);
>
> if (use_sideband)
> send_sideband(1, 1, buf.buf, buf.len, use_sideband);A bit hard to see, but aren't these two functions now exactly the same except for the enum passed to `generate_report()`?
Patrick