From 1a60f2066aadf68391aed69f4d5914d914b60f5b Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 5 Sep 2024 04:51:49 -0400 Subject: drop trailing newline from warning/error/die messages Our error reporting routines append a trailing newline, and the strings we pass to them should not include them (otherwise we get an extra blank line after the message). These cases were all found by looking at the results of: git grep -P '[^_](error|error_errno|warning|die|die_errno)\(.*\\n"[,)]' '*.c' Note that we _do_ sometimes include a newline in the middle of such messages, to create multiline output (hence our grep matching "," or ")" after we see the newline, so we know we're at the end of the string). It's possible that one or more of these cases could intentionally be including a blank line at the end, but having looked at them all manually, I think these are all just mistakes. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- send-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'send-pack.c') diff --git a/send-pack.c b/send-pack.c index 9666b2c995..5d0c23772a 100644 --- a/send-pack.c +++ b/send-pack.c @@ -626,7 +626,7 @@ int send_pack(struct send_pack_args *args, strbuf_release(&req_buf); strbuf_release(&cap_buf); reject_atomic_push(remote_refs, args->send_mirror); - error("atomic push failed for ref %s. status: %d\n", + error("atomic push failed for ref %s. status: %d", ref->name, ref->status); return args->porcelain ? 0 : -1; } -- cgit 1.2.3-korg