Re: [PATCH v8] submodule merge: update conflict error message
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 16, 2022, 18:58 UTC
- Message-ID
- <xmqqk078t3r6.fsf@gitster.g>
- In-Reply-To
- <xmqqczd0xjrp.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
>> + * languages, the following swap is suggested:
>> + * " %s\n" -> "%s \n"
>> + */
>> + strbuf_addf(&tmp, _(" %s\n"), msg_list.items[i].string);
>> + }
>> + strbuf_reset(msg);
>> + strbuf_add(msg, tmp.buf, tmp.len);
>> +}
>
> Here, tmp is not released, and mst_list holds the words split out of msg.FWIW, with this fixed, the tip of 'seen' passes the linux-leaks CI job.
Show 16 quoted lines
> merge-ort.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git i/merge-ort.c w/merge-ort.c
> index 4cb92bdff8..cdb53770be 100644
> --- i/merge-ort.c
> +++ w/merge-ort.c
> @@ -4507,6 +4507,8 @@ static void format_submodule_conflict_suggestion(struct strbuf *msg) {
> }
> strbuf_reset(msg);
> strbuf_add(msg, tmp.buf, tmp.len);
> + string_list_clear(&msg_list, 0);
> + strbuf_release(&tmp);
> }
>
> static void print_submodule_conflict_suggestion(struct string_list *csub) {