inveniosoftware / inveniosoftware/dictdiffer
Unifier class: `unify` method returns duplicated patches
Open
Status: in work
Type: bug
- Dominant language
- Python
- Stars
- 849
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Unifier class: `unify` method returns a list containing duplicated patches in the case of conflicts containing equal patches (same path).
e.g.
```
patch1 = ('remove', '', [('a', 'b')])
patch2 = ('remove', '', [('a', 'b')])
conflicts = Conflict(patch1, patch2)
conflicts.take = 'f' # can be 's' too
```
The result of calling `u.unify([patch1], [patch2], [conflicts])` will be `[patch1, patch2]` instead of `[patch1]`. This particular case can lead to `KeyError`s in case of calling `patch`, as it will try to remove the same key twice. The second time it fails as the key has already been deleted.
Contributor guide
Assessment
This issue has not been assessed yet.