aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-01-17 10:03:06 -0500
committerJunio C Hamano <gitster@pobox.com>2008-01-18 01:29:38 -0800
commit472ca780773ac75fa6af881117ce5360957fae2d (patch)
treeb97650f1d644df66457763b00617b9a6eccc46d5 /diff.c
parentbfa8fccf477ed2567b035f1c6a3cb2b74ec4ef67 (diff)
downloadgit-472ca780773ac75fa6af881117ce5360957fae2d.tar.gz
git-472ca780773ac75fa6af881117ce5360957fae2d.tar.xz
color unchanged lines as "plain" in "diff --color-words"
These were mistakenly being colored in "meta" color. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/diff.c b/diff.c
index 9ee0c41ba..5b8afdcb0 100644
--- a/diff.c
+++ b/diff.c
@@ -552,7 +552,8 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
int i;
int color;
struct emit_callback *ecbdata = priv;
- const char *set = diff_get_color(ecbdata->color_diff, DIFF_METAINFO);
+ const char *meta = diff_get_color(ecbdata->color_diff, DIFF_METAINFO);
+ const char *plain = diff_get_color(ecbdata->color_diff, DIFF_PLAIN);
const char *reset = diff_get_color(ecbdata->color_diff, DIFF_RESET);
*(ecbdata->found_changesp) = 1;
@@ -564,9 +565,9 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
name_b_tab = strchr(ecbdata->label_path[1], ' ') ? "\t" : "";
printf("%s--- %s%s%s\n",
- set, ecbdata->label_path[0], reset, name_a_tab);
+ meta, ecbdata->label_path[0], reset, name_a_tab);
printf("%s+++ %s%s%s\n",
- set, ecbdata->label_path[1], reset, name_b_tab);
+ meta, ecbdata->label_path[1], reset, name_b_tab);
ecbdata->label_path[0] = ecbdata->label_path[1] = NULL;
}
@@ -586,7 +587,6 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
}
if (len < ecbdata->nparents) {
- set = reset;
emit_line(reset, reset, line, len);
return;
}
@@ -610,7 +610,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
diff_words_show(ecbdata->diff_words);
line++;
len--;
- emit_line(set, reset, line, len);
+ emit_line(plain, reset, line, len);
return;
}
for (i = 0; i < ecbdata->nparents && len; i++) {