Merge branch 'jc/maint-diff-patch-header' into maint

"git diff-index" and its friends at the plumbing level showed the
"diff --git" header and nothing else for a path whose cached stat
info is dirty without actual difference when asked to produce a
patch. This was a longstanding bug that we could have fixed long
time ago.

By Junio C Hamano
* jc/maint-diff-patch-header:
  diff -p: squelch "diff --git" header for stat-dirty paths
  t4011: illustrate "diff-index -p" on stat-dirty paths
  t4011: modernise style
This commit is contained in:
Junio C Hamano
2012-03-12 15:46:32 -07:00
2 changed files with 111 additions and 86 deletions

2
diff.c
View File

@ -2210,7 +2210,7 @@ static void builtin_diff(const char *name_a,
struct emit_callback ecbdata;
const struct userdiff_funcname *pe;
if (!DIFF_XDL_TST(o, WHITESPACE_FLAGS) || must_show_header) {
if (must_show_header) {
fprintf(o->file, "%s", header.buf);
strbuf_reset(&header);
}