Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 7f3b8c6

Browse files
andrewkwwgitster
authored andcommitted
git add -e: Explicitly specify that patch should have no color
After 4c7f181 (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 <[email protected]> Acked-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4c7f181 commit 7f3b8c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/add.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
238238

239239
argc = setup_revisions(argc, argv, &rev, NULL);
240240
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
241+
rev.diffopt.use_color = 0;
241242
DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
242243
out = open(file, O_CREAT | O_WRONLY, 0666);
243244
if (out < 0)

0 commit comments

Comments
 (0)