summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-08-13 11:33:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 17:44:51 (GMT)
commit1cdde296a5d3b0fd17a3fcd7a0869550b064fdce (patch)
treef48a1106036a2bd2666f930685f961d48b2f6a83 /diff.c
parent5e242e63d0e9955a37268cc6b93b4e8fdedde07f (diff)
downloadgit-1cdde296a5d3b0fd17a3fcd7a0869550b064fdce.zip
git-1cdde296a5d3b0fd17a3fcd7a0869550b064fdce.tar.gz
git-1cdde296a5d3b0fd17a3fcd7a0869550b064fdce.tar.bz2
range-diff: suppress the diff headers
When showing the diff between corresponding patches of the two branch versions, we have to make up a fake filename to run the diff machinery. That filename does not carry any meaningful information, hence tbdiff suppresses it. So we should, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 04d044b..9c4bd9f 100644
--- a/diff.c
+++ b/diff.c
@@ -3395,13 +3395,16 @@ static void builtin_diff(const char *name_a,
memset(&xpp, 0, sizeof(xpp));
memset(&xecfg, 0, sizeof(xecfg));
memset(&ecbdata, 0, sizeof(ecbdata));
+ if (o->flags.suppress_diff_headers)
+ lbl[0] = NULL;
ecbdata.label_path = lbl;
ecbdata.color_diff = want_color(o->use_color);
ecbdata.ws_rule = whitespace_rule(name_b);
if (ecbdata.ws_rule & WS_BLANK_AT_EOF)
check_blank_at_eof(&mf1, &mf2, &ecbdata);
ecbdata.opt = o;
- ecbdata.header = header.len ? &header : NULL;
+ if (header.len && !o->flags.suppress_diff_headers)
+ ecbdata.header = &header;
xpp.flags = o->xdl_opts;
xpp.anchors = o->anchors;
xpp.anchors_nr = o->anchors_nr;