]> git.ipfire.org Git - thirdparty/git.git/commitdiff
apply: respect merge.conflictStyle in --3way
authorDenton Liu <liu.denton@gmail.com>
Wed, 23 Oct 2019 23:32:38 +0000 (16:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Oct 2019 02:32:53 +0000 (11:32 +0900)
Before, when doing a 3-way merge, the merge.conflictStyle option was not
respected and the "merge" style was always used, even if "diff3" was
specified.

Call git_xmerge_config() at the end of git_apply_config() so that the
merge.conflictStyle config is read.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
apply.c
t/t4108-apply-threeway.sh

diff --git a/apply.c b/apply.c
index cde95369bb3f3a9c763108fd91e1e48e0e455e29..84704572ca95083333a7698c7257b2a8d2ee77ff 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -32,7 +32,7 @@ static void git_apply_config(void)
 {
        git_config_get_string_const("apply.whitespace", &apply_default_whitespace);
        git_config_get_string_const("apply.ignorewhitespace", &apply_default_ignorewhitespace);
 {
        git_config_get_string_const("apply.whitespace", &apply_default_whitespace);
        git_config_get_string_const("apply.ignorewhitespace", &apply_default_ignorewhitespace);
-       git_config(git_default_config, NULL);
+       git_config(git_xmerge_config, NULL);
 }
 
 static int parse_whitespace_option(struct apply_state *state, const char *option)
 }
 
 static int parse_whitespace_option(struct apply_state *state, const char *option)
index bffe37f1baa1f0dbeb0710ab511c38deed247339..d7349ced6be0aa1d717dbd0c312a65c8314235b3 100755 (executable)
@@ -73,7 +73,7 @@ test_expect_success 'apply with --3way' '
        test_apply_with_3way
 '
 
        test_apply_with_3way
 '
 
-test_expect_failure 'apply with --3way with merge.conflictStyle = diff3' '
+test_expect_success 'apply with --3way with merge.conflictStyle = diff3' '
        test_config merge.conflictStyle diff3 &&
        test_apply_with_3way
 '
        test_config merge.conflictStyle diff3 &&
        test_apply_with_3way
 '