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);
});
I have two diffs, one from
commit.getDiffWithOptionsand one fromNodeGit.Diff.treeToWorkdirWithIndexwhere 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:Here's some kind of pseudo code