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

[PATCH v2 5/5] trailer: add test with an old style conflict block

From
Christian Couder <chriscool@tuxfamily.org>
Date
Nov 9, 2014, 09:23 UTC
Message-ID
<20141109092344.4864.23949.chriscool@tuxfamily.org>
In-Reply-To
<20141109092313.4864.54933.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/t7513-interpret-trailers.sh | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh
index fed053a..bd0ab46 100755
--- a/t/t7513-interpret-trailers.sh
+++ b/t/t7513-interpret-trailers.sh
@@ -213,7 +213,7 @@ test_expect_success 'with 2 files arguments' '
 '
 
 test_expect_success 'with message that has comments' '
-	cat basic_message >>message_with_comments &&
+	cat basic_message >message_with_comments &&
 	sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
 		# comment
 
@@ -240,6 +240,36 @@ test_expect_success 'with message that has comments' '
 	test_cmp expected actual
 '
 
+test_expect_success 'with message that has an old style conflict block' '
+	cat basic_message >message_with_comments &&
+	sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
+		# comment
+
+		# other comment
+		Cc: Z
+		# yet another comment
+		Reviewed-by: Johan
+		Reviewed-by: Z
+		# last comment
+
+		Conflicts:
+
+	EOF
+	cat basic_message >expected &&
+	cat >>expected <<-\EOF &&
+		# comment
+
+		Reviewed-by: Johan
+		Cc: Peff
+		# last comment
+
+		Conflicts:
+
+	EOF
+	git interpret-trailers --trim-empty --trailer "Cc: Peff" message_with_comments >actual &&
+	test_cmp expected actual
+'
+
 test_expect_success 'with commit complex message and trailer args' '
 	cat complex_message_body >expected &&
 	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
-- 
2.1.2.555.gfbecd99
Previous: Junio C Hamano
Message 9 of 9 in “Small "git interpret-trailers" fixes”
  1. 0/5 Small "git interpret-trailers" fixesChristian Couder, Nov 9, 2014
  2. 1/5 trailer: ignore comment lines inside the trailersChristian Couder, Nov 9, 2014
  3. 2/5 trailer: display a trailer without its trailing newlineChristian Couder, Nov 9, 2014
  4. 3/5 commit: make ignore_non_trailer() non staticChristian Couder, Nov 9, 2014
  5. 4/5 trailer: reuse ignore_non_trailer() to ignore conflict linesChristian Couder, Nov 9, 2014
  6. Junio C HamanoNov 10, 2014
  7. Christian CouderNov 10, 2014
  8. Junio C HamanoNov 10, 2014
  9. 5/5 trailer: add test with an old style conflict blockChristian Couder, Nov 9, 2014

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.