diff options
author | Jeff King <peff@peff.net> | 2024-09-05 10:51:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-09-05 18:07:12 +0200 |
commit | 1a60f2066aadf68391aed69f4d5914d914b60f5b (patch) | |
tree | 3f95d066dcae08cb04c0f51f91fc3d5168ffc679 /loose.c | |
parent | The twelfth batch (diff) | |
download | git-1a60f2066aadf68391aed69f4d5914d914b60f5b.tar.xz git-1a60f2066aadf68391aed69f4d5914d914b60f5b.zip |
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'loose.c')
-rw-r--r-- | loose.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -162,7 +162,7 @@ int repo_write_loose_object_map(struct repository *repo) errout: rollback_lock_file(&lock); strbuf_release(&buf); - error_errno(_("failed to write loose object index %s\n"), path.buf); + error_errno(_("failed to write loose object index %s"), path.buf); strbuf_release(&path); return -1; } @@ -197,7 +197,7 @@ static int write_one_object(struct repository *repo, const struct object_id *oid strbuf_release(&path); return 0; errout: - error_errno(_("failed to write loose object index %s\n"), path.buf); + error_errno(_("failed to write loose object index %s"), path.buf); close(fd); rollback_lock_file(&lock); strbuf_release(&buf); |