Allow passing a Reference to Repository.merge() #1348
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows passing more types to Repository.merge. Previously, you could only pass a commit ID as an Oid or an str.
In addition to these two, you can now also pass a real Commit, or a Reference.
Passing in a Reference will enrich the merge with additional information. For example, Repository.message will specify the name of the branch being merged, instead of just stating a commit ID:
If this PR is accepted, I believe passing an str should now be deprecated. The str is supposed to represent a commit ID, but users might intuit that the function also accepts ref names as an str, when in fact they should pass a real Reference object.