Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Diff.merge: inconsistent behavior #1002

Copy link
Copy link
@smith-kyle

Description

@smith-kyle
Issue body actions

I have two diffs, one from commit.getDiffWithOptions and one from NodeGit.Diff.treeToWorkdirWithIndex where the tree is from the head commit. They were made with the same options. When merging the two diffs, depending on which diff is merged into which, either the diffs will merge or this error will be thrown:

Error: Attempt to merge diffs created with conflicting options

Here's some kind of pseudo code

let workDirWithIndexDiff;
repo.getHeadCommit()
  .then(headCommit => headCommit.getTree())
  .then(headTree => NodeGit.Diff.treeToWorkdirWithIndex(repo, headTree, {}))
  .then(_workDirWithIndexDiff => {
    workDirWithIndexDiff = _workDirWithIndexDiff;
    return someCommit.getDiffWithOptions({});
  })
  .then(someDiff => {
    // This would reject with Error: Attempt to merge diffs created with conflicting options
    someDiff.merge(workDirWithIndexDiff);

    // This would resolve
    workDirWithIndexDiff.merge(someDiff);
  });
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.