summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorAndrew Wong <andrew.kw.w@gmail.com>2013-07-18 22:58:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-19 18:20:28 (GMT)
commit7f3b8c628eaea8ccbe83f605b00d629553b70b42 (patch)
tree59901974c510ee564a76de1c18af7832a4298de3 /builtin/add.c
parent4c7f1819b3c142ace98269a556bc929c80e7c9fd (diff)
downloadgit-7f3b8c628eaea8ccbe83f605b00d629553b70b42.zip
git-7f3b8c628eaea8ccbe83f605b00d629553b70b42.tar.gz
git-7f3b8c628eaea8ccbe83f605b00d629553b70b42.tar.bz2
git add -e: Explicitly specify that patch should have no color
After 4c7f1819 (make color.ui default to 'auto', 2013-06-10), the patch file to be edited during 'git add -e' receives all the color codes. This is because diffopt.use_color defaults to -1, which causes want_color to now return 'auto'. By explicitly setting use_color to 0, we can ensure the diff output has no color codes in it. Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/add.c b/builtin/add.c
index ab1c9e8..8b2aa5b 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -238,6 +238,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
argc = setup_revisions(argc, argv, &rev, NULL);
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
+ rev.diffopt.use_color = 0;
DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
out = open(file, O_CREAT | O_WRONLY, 0666);
if (out < 0)