diff options
author | Peter Grayson <pete@jpgrayson.net> | 2022-12-14 18:41:51 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-15 01:12:04 +0100 |
commit | 209d9cb0114dff72e96d58bb3c27409660f1b45c (patch) | |
tree | 3485c675b867aa08c6841f58200570fc1c931871 /diff.c | |
parent | diff.c: use utf8_strwidth() to count display width (diff) | |
download | git-209d9cb0114dff72e96d58bb3c27409660f1b45c.tar.xz git-209d9cb0114dff72e96d58bb3c27409660f1b45c.zip |
diff: fix regression with --stat and unmerged file
A regression was introduced in
12fc4ad89e (diff.c: use utf8_strwidth() to count display width, 2022-09-14)
that causes missing newlines after "Unmerged" entries in `git diff
--cached --stat` output.
This problem affects v2.39.0-rc0 through v2.39.0.
Add the missing newline along with a new test to cover this
behavior.
Signed-off-by: Peter Grayson <pete@jpgrayson.net>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2784,7 +2784,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options) else if (file->is_unmerged) { strbuf_addf(&out, " %s%s%*s | %*s", prefix, name, padding, "", - number_width, "Unmerged"); + number_width, "Unmerged\n"); emit_diff_symbol(options, DIFF_SYMBOL_STATS_LINE, out.buf, out.len, 0); strbuf_reset(&out); |