libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.61k stars 385 forks source link

Allow passing merge options to merge #1192

Closed rohitsanj closed 1 year ago

rohitsanj commented 1 year ago

This PR reimplements the merge method using cffi and removes the C implementation.

In addition, the merge method will now accept additional arguments favor, flags and file_flags to have more control over merge options.

The existing merge tests pass. I'm not sure what other cases need to be tested.

jdavid commented 1 year ago

Looks good, do you think you could add unit tests for the options? There are similar unit tests for other parts of the API, e.g. test_merge_commits_favor

rohitsanj commented 1 year ago

Sure, I can add unit tests.

I was confident about the functionality of the merge options passthrough in this implementation since the _merge_options method seems decently unit tested.