Skip to content

Panic on 3-way merge #9

Closed
Closed
@mxfunc

Description

@mxfunc

Test Case:

fn main() {

let base = r#"
class GithubCall(db.Model):

`url`: URL of request Example.`https://api.github.com`"#;

    let theirs = r#"
class GithubCall(db.Model):

`repo`: String field. Github repository fields. Example: `amitu/python`"#;

    let ours = r#"
class Call(models.Model):
`body`: String field. The payload of the webhook call from the github.

`repo`: String field. Github repository fields. Example: `amitu/python`"#;

    println!("Diffy merge test");
    match diffy::merge(base, ours, theirs) {
        Ok(s) => {
            println!("{}", s);
        }
        Err(s) => {
            println!("{}", s);
        }
    }
}

Findings:

  • The panic disappears if the clean_conficts function is commented.
  • The panic disappears if the ConflictStyle is changed from ConflictStyle::Diff3 to ConflictStyle::Merge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions