X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=diff-tree.c;h=2ec0d6fa81e083f0e9dcbda17ce0b1b9a9e1f4fc;hb=5831b563a442e7c3198a444a51d8caba4d072506;hp=0fd28f12883e7e99d73d3b35f536e8168a366c06;hpb=09d74b3b5ac634495e17b92b2b785fa996ffce97;p=git.git diff --git a/diff-tree.c b/diff-tree.c index 0fd28f12..2ec0d6fa 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -277,7 +277,18 @@ static int call_diff_flush(void) if (nr_paths) diffcore_pathspec(paths); if (header) { - printf("%s", header); + if (diff_output_format == DIFF_FORMAT_MACHINE) { + const char *ep, *cp; + for (cp = header; *cp; cp = ep) { + ep = strchr(cp, '\n'); + if (ep == 0) ep = cp + strlen(cp); + printf("%.*s%c", ep-cp, cp, 0); + if (*ep) ep++; + } + } + else { + printf("%s", header); + } header = NULL; } diff_flush(diff_output_format);