Re: [PATCH 4/7] checkout: fix merge.conflictstyle handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/06/2021 20:28, Felipe Contreras wrote:
[...]
diff --git a/merge-recursive.c b/merge-recursive.c
index d146bb116f..10e6e1e4d1 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -3845,7 +3845,7 @@ static void merge_recursive_config(struct merge_options *opt)
  		} /* avoid erroring on values from future versions of git */
  		free(value);
  	}
-	git_config(git_xmerge_config, NULL);
+	git_config(git_default_config, NULL);

Now that all callers are required to call git_config(git_xmerge_config) before calling init_merge_options() this line can be deleted.

Best Wishes

Phillip

  }
>
  void init_merge_options(struct merge_options *opt,
diff --git a/sequencer.c b/sequencer.c
index 0bec01cf38..9e2bdca0f6 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -34,6 +34,7 @@
  #include "commit-reach.h"
  #include "rebase-interactive.h"
  #include "reset.h"
+#include "xdiff-interface.h"
#define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION" @@ -224,6 +225,10 @@ static int git_sequencer_config(const char *k, const char *v, void *cb)
  	if (status)
  		return status;
+ status = git_xmerge_config(k, v, NULL);
+	if (status)
+		return status;
+
  	return git_diff_basic_config(k, v, NULL);
  }
diff --git a/t/t6440-config-conflict-markers.sh b/t/t6440-config-conflict-markers.sh
index 44f79ac91b..485ad0eee0 100755
--- a/t/t6440-config-conflict-markers.sh
+++ b/t/t6440-config-conflict-markers.sh
@@ -89,4 +89,35 @@ test_expect_success 'notes' '
  	)
  '
+test_expect_success 'checkout' '
+	test_create_repo checkout &&
+	(
+		test_commit checkout &&
+
+		fill a b c d e >content &&
+		git add content &&
+		git commit -m initial &&
+
+		git checkout -b simple master &&
+		fill a c e >content &&
+		git commit -a -m simple &&
+
+		fill b d >content &&
+		git checkout --merge master &&
+		! grep -E "\|+" content &&
+
+		git config merge.conflictstyle merge &&
+
+		git checkout -f simple &&
+		fill b d >content &&
+		git checkout --merge --conflict=diff3 master &&
+		grep -E "\|+" content &&
+
+		git checkout -f simple &&
+		fill b d >content &&
+		git checkout --merge --conflict=merge master &&
+		! grep -E "\|+" content
+	)
+'
+
  test_done




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux