summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-09-07 23:36:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-08 20:54:37 (GMT)
commitca9b37e5a8a76b7b5c9990481ce4f9894dd40392 (patch)
treee1b253742f896401d14282972c234be316d654f6 /diff.c
parentba16233ccd98ee8db6d418903102c8730d87dcc5 (diff)
downloadgit-ca9b37e5a8a76b7b5c9990481ce4f9894dd40392.zip
git-ca9b37e5a8a76b7b5c9990481ce4f9894dd40392.tar.gz
git-ca9b37e5a8a76b7b5c9990481ce4f9894dd40392.tar.bz2
diff: remove dead code
When `len < 1`, len has to be 0 or negative, emit_line will then remove the first character and by then `len` would be negative. As this doesn't happen, it is safe to assume it is dead code. This continues to simplify the code, which was started in b8d9c1a66b (2009-09-03, diff.c: the builtin_diff() deals with only two-file comparison). Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/diff.c b/diff.c
index 34aa855..cc8e812 100644
--- a/diff.c
+++ b/diff.c
@@ -1252,14 +1252,6 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
return;
}
- if (len < 1) {
- emit_line(o, reset, reset, line, len);
- if (ecbdata->diff_words
- && ecbdata->diff_words->type == DIFF_WORDS_PORCELAIN)
- fputs("~\n", o->file);
- return;
- }
-
if (ecbdata->diff_words) {
if (line[0] == '-') {
diff_words_append(line, len,