libgit2/pygit2 — pull request #295 by victorgp (2013-12-04 17:48:50+00:00)
Title: Implementing merge with default options

This pull request implements the merge operation based on the default options libgit2 defines.

The merge receives an Oid and returns a MergeResult object.

This MergeResult object is quite similar than the git_merge_result libgit2 implements. it has:

->is_fastforward: boolean field that indicates the merge was fastforward
->is_uptodate: boolean field that indicates the merge was already up to date
->fastforward_oid: python Oid object with the new fastforward Oid to be the new head (only if the merge was fastforward, None otherwise)
->status: dict with the repository status after the merge (if the merge was not fastforward, either there were conflicts or not, an empty dict otherwise)

Some notes:
-The merge, as it name says, only does the merge, it does not perform any commit nor updates the references (ex. in the fastforward case)
-This method does not allow customized parameters for the merge operation, i would like to leave that for a second iteration over this method and let's it work for the moment with the default options defined in the libgit2 constant GIT_MERGE_OPTS_INIT.

The tests i implemented would help to understand this behaviour easily.

Extra: there is also a minor change in the Repository_status method, i removed the args parameter because it wasn't being used anywhere within the method.