diff --git a/builtin/log.c b/builtin/log.c index a70fba198f..eaf511aab8 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1085,6 +1085,15 @@ static int git_format_config(const char *var, const char *value, void *cb) return 0; } + /* + * ignore some porcelain config which would otherwise be parsed by + * git_diff_ui_config(), via git_log_config(); we can't just avoid + * diff_ui_config completely, because we do care about some ui options + * like color. + */ + if (!strcmp(var, "diff.noprefix")) + return 0; + return git_log_config(var, value, cb); } diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index f3313b8c58..f5a41fd47e 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -2386,4 +2386,9 @@ test_expect_success 'interdiff: solo-patch' ' test_cmp expect actual ' +test_expect_success 'format-patch does not respect diff.noprefix' ' + git -c diff.noprefix format-patch -1 --stdout >actual && + grep "^--- a/blorp" actual +' + test_done