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>
-cat > expected1.txt <<EOF
+# git gives this result before commit 606475f3 ...
+cat > expected1a.txt <<EOF
foo1
<<<<<<< current:foo/bar
=======
foo1
<<<<<<< current:foo/bar
=======
foo3
>>>>>>> patched:foo/bar
EOF
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
cat > expected2.txt <<EOF
bar
EOF
(cd foo && stg goto --keep p3) ;
[ $? -eq 3 ] &&
cat foo/bar > actual.txt &&
(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
'
ls foo > actual.txt &&
test_cmp expected2.txt actual.txt
'