Skip to content

Commit

Permalink
builtin-commit: do not color status output shown in the message template
Browse files Browse the repository at this point in the history
Noticed by Ping Yin on the list.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Nov 23, 2007
1 parent a50f9fc commit bc5d248
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static const char sign_off_header[] = "Signed-off-by: ";
static int prepare_log_message(const char *index_file, const char *prefix)
{
struct stat statbuf;
int commitable;
int commitable, saved_color_setting;
struct strbuf sb;
char *buffer;
FILE *fp;
Expand Down Expand Up @@ -243,7 +243,10 @@ static int prepare_log_message(const char *index_file, const char *prefix)
if (only_include_assumed)
fprintf(fp, "# %s\n", only_include_assumed);

saved_color_setting = wt_status_use_color;
wt_status_use_color = 0;
commitable = run_status(fp, index_file, prefix);
wt_status_use_color = saved_color_setting;

fclose(fp);

Expand Down
1 change: 1 addition & 0 deletions wt-status.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct wt_status {
};

int git_status_config(const char *var, const char *value);
int wt_status_use_color;
void wt_status_prepare(struct wt_status *s);
void wt_status_print(struct wt_status *s);

Expand Down

0 comments on commit bc5d248

Please sign in to comment.