summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-01-18 23:16:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-01-18 23:16:19 (GMT)
commit05c65cb1161f232c65b186d6d6eb3bce9c6a0924 (patch)
tree6eb5898b90cadc7196cffb9c9ad0ddabe12b914f /diff.c
parentb63103e908af54e5e2eaa3faad350e4738ef0047 (diff)
parentc7c2bc0ac9e7f077771db53960d4917fda4b27a7 (diff)
downloadgit-05c65cb1161f232c65b186d6d6eb3bce9c6a0924.zip
git-05c65cb1161f232c65b186d6d6eb3bce9c6a0924.tar.gz
git-05c65cb1161f232c65b186d6d6eb3bce9c6a0924.tar.bz2
Merge branch 'tr/maint-word-diff-incomplete-line'
* tr/maint-word-diff-incomplete-line: word-diff: ignore '\ No newline at eof' marker
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 374ecf3..7e15426 100644
--- a/diff.c
+++ b/diff.c
@@ -1113,6 +1113,15 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
diff_words_append(line, len,
&ecbdata->diff_words->plus);
return;
+ } else if (!prefixcmp(line, "\\ ")) {
+ /*
+ * Eat the "no newline at eof" marker as if we
+ * saw a "+" or "-" line with nothing on it,
+ * and return without diff_words_flush() to
+ * defer processing. If this is the end of
+ * preimage, more "+" lines may come after it.
+ */
+ return;
}
diff_words_flush(ecbdata);
if (ecbdata->diff_words->type == DIFF_WORDS_PORCELAIN) {