builtin-commit: do not color status output shown in the message template
Noticed by Ping Yin on the list. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Nov 18, 2007 at 12:01 UTC
bc5d248a9fba11cb78dd0a3a91938d881dec1245
2 files changed
+5
-1
builtin-commit.c
+4
-1
@@ -159,7 +159,7 @@ static const char sign_off_header[] = "Signed-off-by: ";
159
static int prepare_log_message(const char *index_file, const char *prefix)
160
{
161
struct stat statbuf;
162
- int commitable;
162
+ int commitable, saved_color_setting;
163
struct strbuf sb;
164
char *buffer;
165
FILE *fp;
@@ -243,7 +243,10 @@ static int prepare_log_message(const char *index_file, const char *prefix)
243
if (only_include_assumed)
244
fprintf(fp, "# %s\n", only_include_assumed);
245
246
+ saved_color_setting = wt_status_use_color;
247
+ wt_status_use_color = 0;
248
commitable = run_status(fp, index_file, prefix);
249
+ wt_status_use_color = saved_color_setting;
250
251
fclose(fp);
252
wt-status.h
+1
@@ -27,6 +27,7 @@ struct wt_status {
27
};
28
29
int git_status_config(const char *var, const char *value);
30
+int wt_status_use_color;
31
void wt_status_prepare(struct wt_status *s);
32
void wt_status_print(struct wt_status *s);
33