git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 1/4] test: add merge style config test

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 10, 2023, 21:37 UTC
Message-ID
<20230510213738.505241-2-felipe.contreras@gmail.com>
In-Reply-To
<20230510213738.505241-1-felipe.contreras@gmail.com>

We want to test different combinations of merge.conflictstyle, and a new file is the best place to do that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t6440-config-conflict-markers.sh | 37 ++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100755 t/t6440-config-conflict-markers.sh
diff --git a/t/t6440-config-conflict-markers.sh b/t/t6440-config-conflict-markers.sh
new file mode 100755
index 0000000000..813d7dda9a
--- /dev/null
+++ b/t/t6440-config-conflict-markers.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+test_description='merge style conflict markers configurations'
+
+. ./test-lib.sh
+
+test_expect_success 'merge' '
+	test_create_repo merge &&
+	(
+		cd merge &&
+
+		test_write_lines 1 2 3 >content &&
+		git add content &&
+		git commit -m base &&
+
+		git checkout -b r &&
+		echo six >>content &&
+		git commit -a -m right &&
+
+		git checkout master &&
+		echo 7 >>content &&
+		git commit -a -m left &&
+
+		test_must_fail git merge r &&
+		! grep "^|||||||" content &&
+
+		git reset --hard &&
+		test_must_fail git -c merge.conflictstyle=diff3 merge r &&
+		grep "^|||||||" content &&
+
+		git reset --hard &&
+		test_must_fail git -c merge.conflictstyle=merge merge r &&
+		! grep "^|||||||" content
+	)
+'
+
+test_done
-- 
2.40.0+fc1
Previous: Felipe ContrerasNext: Felipe Contreras
Message 2 of 5 in “Generic conflict style fixes”
  1. 0/4 Generic conflict style fixesFelipe Contreras, May 10, 2023
  2. 1/4 test: add merge style config testFelipe Contreras, May 10, 2023
  3. 2/4 merge-tree: fix merge.conflictstyle handlingFelipe Contreras, May 10, 2023
  4. 4/4 test: document broken merge.conflictStyle handlingFelipe Contreras, May 10, 2023
  5. 3/4 notes: fix merge.conflictstyle handlingFelipe Contreras, May 10, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.