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

[PATCH v2 3/3] t7405: verify 'merge --abort' works after submodule/path conflicts

From
Elijah Newren <newren@gmail.com>
Date
Jul 11, 2018, 03:56 UTC
Message-ID
<20180711035659.27352-4-newren@gmail.com>
In-Reply-To
<20180711035659.27352-1-newren@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t7405-submodule-merge.sh | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
diff --git a/t/t7405-submodule-merge.sh b/t/t7405-submodule-merge.sh
index 45d1779d2..7855bd864 100755
--- a/t/t7405-submodule-merge.sh
+++ b/t/t7405-submodule-merge.sh
@@ -333,6 +333,19 @@ test_expect_failure 'file/submodule conflict' '
 	)
 '
 
+test_expect_success 'file/submodule conflict; merge --abort works afterward' '
+	test_when_finished "git -C file-submodule reset --hard" &&
+	(
+		cd file-submodule &&
+
+		git checkout A^0 &&
+		test_must_fail git merge B^0 >out 2>err &&
+
+		test_path_is_file .git/MERGE_HEAD &&
+		git merge --abort
+	)
+'
+
 # Directory/submodule conflict
 #   Commit O: <empty>
 #   Commit A: path (submodule), with sole tracked file named 'world'
@@ -417,7 +430,25 @@ test_expect_failure 'directory/submodule conflict; should not treat submodule fi
 		# merge from starting; we should not be writing to such paths
 		# anyway.
 		test_i18ngrep ! "refusing to lose untracked file at" err
+	)
+'
+
+test_expect_failure 'directory/submodule conflict; merge --abort works afterward' '
+	test_when_finished "git -C directory-submodule/path reset --hard" &&
+	test_when_finished "git -C directory-submodule reset --hard" &&
+	(
+		cd directory-submodule &&
 
+		git checkout A^0 &&
+		test_must_fail git merge B2^0 &&
+		test_path_is_file .git/MERGE_HEAD &&
+
+		# merge --abort should succeed, should clear .git/MERGE_HEAD,
+		# and should not leave behind any conflicted files
+		git merge --abort &&
+		test_path_is_missing .git/MERGE_HEAD &&
+		git ls-files -u >conflicts &&
+		test_must_be_empty conflicts
 	)
 '
 
-- 
2.18.0.132.g6e63b23f4
Previous: Elijah Newren
Message 12 of 12 in “Add testcases showing suboptimal submodule/path conflict handling”
  1. 0/3 Add testcases showing suboptimal submodule/path conflict handlingElijah Newren, Jul 7, 2018
  2. 1/3 t7405: add a file/submodule conflictElijah Newren, Jul 7, 2018
  3. Stefan BellerJul 9, 2018
  4. Elijah NewrenJul 10, 2018
  5. Stefan BellerJul 10, 2018
  6. Elijah NewrenJul 10, 2018
  7. 3/3 t7405: verify 'merge --abort' works after submodule/path conflictsElijah Newren, Jul 7, 2018
  8. 2/3 t7405: add a directory/submodule conflictElijah Newren, Jul 7, 2018
  9. 0/3 Add testcases showing suboptimal submodule/path conflict handlingElijah Newren, Jul 11, 2018
  10. 1/3 t7405: add a file/submodule conflictElijah Newren, Jul 11, 2018
  11. 2/3 t7405: add a directory/submodule conflictElijah Newren, Jul 11, 2018
  12. 3/3 t7405: verify 'merge --abort' works after submodule/path conflictsElijah Newren, Jul 11, 2018

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.