Skip to content

Commit 559357b

Browse files
committed
Merge branch 'ph/format-patch-no-color'
* ph/format-patch-no-color: format-patch: ignore ui.color
2 parents 1e5814f + 787570c commit 559357b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

builtin/log.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ static int git_format_config(const char *var, const char *value, void *cb)
608608
string_list_append(&extra_cc, value);
609609
return 0;
610610
}
611-
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
611+
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff") ||
612+
!strcmp(var, "color.ui")) {
612613
return 0;
613614
}
614615
if (!strcmp(var, "format.numbered")) {

t/t4014-format-patch.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,4 +886,12 @@ test_expect_success 'empty subject prefix does not have extra space' '
886886
test_cmp expect actual
887887
'
888888

889+
test_expect_success 'format patch ignores color.ui' '
890+
test_unconfig color.ui &&
891+
git format-patch --stdout -1 >expect &&
892+
test_config color.ui always &&
893+
git format-patch --stdout -1 >actual &&
894+
test_cmp expect actual
895+
'
896+
889897
test_done

0 commit comments

Comments
 (0)