-
Notifications
You must be signed in to change notification settings - Fork 699
Open
Description
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
Labels
No labels