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

[StGit PATCH] t2800: Adapt to changes in git's conflict markers

From
Karl Wiberg <kha@treskal.com>
Date
Jul 15, 2009, 09:54 UTC
Message-ID
<20090715095312.1705.13477.stgit@october.e.vtech>
From: Karl Wiberg <kha@treskal.com>

The conflict markers used by git were changed slightly by commit 606475f3 ("Remove filename from conflict markers"); specifically, the conflict markers contain the filename only when the filename has changed.

This patch adapts t2800 to allow either the new or the old format.
Signed-off-by: Karl Wiberg <kha@treskal.com>
---
 t/t2800-goto-subdir.sh |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/t/t2800-goto-subdir.sh b/t/t2800-goto-subdir.sh
index 855972b..5960bd6 100755
--- a/t/t2800-goto-subdir.sh
+++ b/t/t2800-goto-subdir.sh
@@ -36,7 +36,8 @@ test_expect_success 'Prepare conflicting goto' '
     stg delete p2
 '
 
-cat > expected1.txt <<EOF
+# git gives this result before commit 606475f3 ...
+cat > expected1a.txt <<EOF
 foo1
 <<<<<<< current:foo/bar
 =======
@@ -44,6 +45,17 @@ foo2
 foo3
 >>>>>>> patched:foo/bar
 EOF
+
+# ... and this result after commit 606475f3.
+cat > expected1b.txt <<EOF
+foo1
+<<<<<<< current
+=======
+foo2
+foo3
+>>>>>>> patched
+EOF
+
 cat > expected2.txt <<EOF
 bar
 EOF
@@ -51,7 +63,8 @@ test_expect_success 'Goto in subdirectory (conflicting push)' '
     (cd foo && stg goto --keep p3) ;
     [ $? -eq 3 ] &&
     cat foo/bar > actual.txt &&
-    test_cmp expected1.txt actual.txt &&
+    ( test_cmp expected1a.txt actual.txt \
+      || test_cmp expected1b.txt actual.txt ) &&
     ls foo > actual.txt &&
     test_cmp expected2.txt actual.txt
 '
Next: Junio C Hamano
Message 1 of 2 in “t2800: Adapt to changes in git's conflict markers”
  1. t2800: Adapt to changes in git's conflict markersKarl Wiberg, Jul 15, 2009
  2. Junio C HamanoJul 18, 2009

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.