mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
trace2: trim trailing whitespace in normal format error message
Avoid creating unnecessary trailing whitespace in normal target format error messages when the message is omitted. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
04f10d332f
commit
ad43e37839
|
@ -142,8 +142,11 @@ static void fn_error_va_fl(const char *file, int line, const char *fmt,
|
|||
{
|
||||
struct strbuf buf_payload = STRBUF_INIT;
|
||||
|
||||
strbuf_addstr(&buf_payload, "error ");
|
||||
maybe_append_string_va(&buf_payload, fmt, ap);
|
||||
strbuf_addstr(&buf_payload, "error");
|
||||
if (fmt && *fmt) {
|
||||
strbuf_addch(&buf_payload, ' ');
|
||||
maybe_append_string_va(&buf_payload, fmt, ap);
|
||||
}
|
||||
normal_io_write_fl(file, line, &buf_payload);
|
||||
strbuf_release(&buf_payload);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue