summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-07-25 13:59:20 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-07-25 13:59:21 -0700
commit43ba21cb574ee3f9a1acf4580868982f4c883ac6 (patch)
tree1c77f20d9d9b2ab52626d3465f057e964bb8b463 /diff.c
parentMerge branch 'ab/test-env' (diff)
parentrange-diff: add headers to the outer hunk header (diff)
downloadtgif-43ba21cb574ee3f9a1acf4580868982f4c883ac6.tar.xz
Merge branch 'tg/range-diff-output-update'
"git range-diff" output has been tweaked for easier identification of which part of what file the patch shown is about. * tg/range-diff-output-update: range-diff: add headers to the outer hunk header range-diff: add filename to inner diff range-diff: add section header instead of diff header range-diff: suppress line count in outer diff range-diff: don't remove funcname from inner diff range-diff: split lines manually range-diff: fix function parameter indentation apply: make parse_git_diff_header public apply: only pass required data to gitdiff_* functions apply: only pass required data to find_name_* apply: only pass required data to check_header_line apply: only pass required data to git_header_name apply: only pass required data to skip_tree_prefix apply: replace marc.info link with public-inbox
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 1ee04e321b..4146993010 100644
--- a/diff.c
+++ b/diff.c
@@ -1673,7 +1673,10 @@ static void emit_hunk_header(struct emit_callback *ecbdata,
if (ecbdata->opt->flags.dual_color_diffed_diffs)
strbuf_addstr(&msgbuf, reverse);
strbuf_addstr(&msgbuf, frag);
- strbuf_add(&msgbuf, line, ep - line);
+ if (ecbdata->opt->flags.suppress_hunk_header_line_count)
+ strbuf_add(&msgbuf, atat, sizeof(atat));
+ else
+ strbuf_add(&msgbuf, line, ep - line);
strbuf_addstr(&msgbuf, reset);
/*