Skip to content

Commit f2bb121

Browse files
stefanbellergitster
authored andcommitted
diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_INCOMPLETE
The context marker use the exact same output pattern, so reuse it. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ff95867 commit f2bb121

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

diff.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ enum diff_symbol {
564564
DIFF_SYMBOL_WORDS_PORCELAIN,
565565
DIFF_SYMBOL_WORDS,
566566
DIFF_SYMBOL_CONTEXT,
567+
DIFF_SYMBOL_CONTEXT_INCOMPLETE,
567568
DIFF_SYMBOL_PLUS,
568569
DIFF_SYMBOL_MINUS,
569570
DIFF_SYMBOL_NO_LF_EOF,
@@ -622,6 +623,7 @@ static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
622623
case DIFF_SYMBOL_CONTEXT_FRAGINFO:
623624
emit_line(o, "", "", line, len);
624625
break;
626+
case DIFF_SYMBOL_CONTEXT_INCOMPLETE:
625627
case DIFF_SYMBOL_CONTEXT_MARKER:
626628
context = diff_get_color_opt(o, DIFF_CONTEXT);
627629
reset = diff_get_color_opt(o, DIFF_RESET);
@@ -1448,8 +1450,8 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
14481450
default:
14491451
/* incomplete line at the end */
14501452
ecbdata->lno_in_preimage++;
1451-
emit_line(o, diff_get_color(ecbdata->color_diff, DIFF_CONTEXT),
1452-
reset, line, len);
1453+
emit_diff_symbol(o, DIFF_SYMBOL_CONTEXT_INCOMPLETE,
1454+
line, len, 0);
14531455
break;
14541456
}
14551457
}

0 commit comments

Comments
 (0)