From f3597138df4de7b695dec42153bdfb2b8164d963 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 29 Jun 2017 17:07:00 -0700 Subject: submodule.c: migrate diff output to use emit_diff_symbol As the submodule process is no longer attached to the same file pointer 'o->file' as the superprojects process, there is a different result in color.c::check_auto_color. That is why we need to pass coloring explicitly, such that the submodule coloring decision will be made by the child process processing the submodule. Only DIFF_SYMBOL_SUBMODULE_PIPETHROUGH contains color, the other symbols are for embedding the submodule output into the superprojects output. Remove the colors from the function signatures, as all the coloring decisions will be made either inside the child process or the final emit_diff_symbol, but not in the functions driving the submodule diff. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'diff.h') diff --git a/diff.h b/diff.h index ea66168454..ae40bac7a9 100644 --- a/diff.h +++ b/diff.h @@ -188,6 +188,15 @@ struct diff_options { int diff_path_counter; }; +void diff_emit_submodule_del(struct diff_options *o, const char *line); +void diff_emit_submodule_add(struct diff_options *o, const char *line); +void diff_emit_submodule_untracked(struct diff_options *o, const char *path); +void diff_emit_submodule_modified(struct diff_options *o, const char *path); +void diff_emit_submodule_header(struct diff_options *o, const char *header); +void diff_emit_submodule_error(struct diff_options *o, const char *err); +void diff_emit_submodule_pipethrough(struct diff_options *o, + const char *line, int len); + enum color_diff { DIFF_RESET = 0, DIFF_CONTEXT = 1, -- cgit v1.2.1