Skip to content

Commit

Permalink
fix: Invalid conflict marker
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed Aug 19, 2024
1 parent 33433bb commit feb07f5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Test {
<<<<<<<<<
=========
<<<<<<<
=======
public static void main ( ) { System . out . println ( "Hello, Joao!" ) ; }
>>>>>>>>>
>>>>>>>
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public abstract class Artifact { public abstract T addChild ( T child ) ; }
public abstract class Artifact { public abstract T addChild ( T child ) ; }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Test {
<<<<<<<<<
<<<<<<<
public static void main ( ) { System . out . println ( "Hello, Joao!" ) ; }
=========
>>>>>>>>>
=======
>>>>>>>
}
6 changes: 3 additions & 3 deletions bin/tests/scenarios/semi_structured/merge.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public class Test { long fibo ( int n ) { if ( n < 2 ) { return n ; } else { return fibo ( n - 1 ) + fibo ( n - 2 ) ; } } int calc ( int a , int b ) { return a
<<<<<<<<<
<<<<<<<
+
=========
=======
*
>>>>>>>>>
>>>>>>>
b ; } }
12 changes: 6 additions & 6 deletions bin/tests/scenarios/smoke_java/merge.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
public class Main { void delete ( Pessoa pessoa ) ; void create ( Pessoa pessoa ) ; public static void main ( String [ ] args ) { int x = 0 ; System . out . println (
<<<<<<<<<
<<<<<<<
"Hello, João!"
=========
=======
"Hello, Paulo!"
>>>>>>>>>
>>>>>>>
) ; int y =
<<<<<<<<<
<<<<<<<
3
=========
=======
5
>>>>>>>>>
>>>>>>>
; } void upsert ( Pessoa pessoa ) ; }
12 changes: 6 additions & 6 deletions bin/tests/scenarios/unordered_with_non_labelled/merge.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
public class Main { static { int
<<<<<<<<<
<<<<<<<
x
=========
=======
y
>>>>>>>>>
>>>>>>>
=
<<<<<<<<<
<<<<<<<
0
=========
=======
2
>>>>>>>>>
>>>>>>>
; } static { System . out . println ( "I'm a static block" ) ; } public Main ( ) { System . out . println ( "I'm a constructor" ) ; int y = 3 ; } static { System . out . println ( "I don't know what's going on" ) ; } }
18 changes: 9 additions & 9 deletions merge/src/merged_cst_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ impl Display for MergedCSTNode<'_> {
MergedCSTNode::Conflict { left, right } => match (left, right) {
(Some(left), Some(right)) => {
writeln!(f)?;
writeln!(f, "<<<<<<<<<")?;
writeln!(f, "<<<<<<<")?;
writeln!(f, "{}", left)?;
writeln!(f, "=========")?;
writeln!(f, "=======")?;
writeln!(f, "{}", right)?;
writeln!(f, ">>>>>>>>>")
writeln!(f, ">>>>>>>")
}
(Some(left), None) => {
writeln!(f)?;
writeln!(f, "<<<<<<<<<")?;
writeln!(f, "<<<<<<<")?;
writeln!(f, "{}", left)?;
writeln!(f, "=========")?;
writeln!(f, ">>>>>>>>>")
writeln!(f, "=======")?;
writeln!(f, ">>>>>>>")
}
(None, Some(right)) => {
writeln!(f)?;
writeln!(f, "<<<<<<<<<")?;
writeln!(f, "=========")?;
writeln!(f, "<<<<<<<")?;
writeln!(f, "=======")?;
writeln!(f, "{}", right)?;
writeln!(f, ">>>>>>>>>")
writeln!(f, ">>>>>>>")
}
(None, None) => unreachable!("Invalid conflict provided"),
},
Expand Down

0 comments on commit feb07f5

Please sign in to comment.