Open
Description
The git-branch doc states
With --contains, shows only the branches that contain the named commit (in other
words, the branches whose tip commits are descendants of the named commit).
With --merged, only branches merged into the named commit (i.e. the branches whose
tip commits are reachable from the named commit) will be listed.
With --no-merged only branches not merged into the named commit will be listed.
If the <commit> argument is missing it defaults to HEAD (i.e. the tip of the
current branch).
A potential API design might rely on the following
- Add a
QueryBy()
method to theBranchCollection
in a similar way to theCommitCollection.QueryBy()
method. - Rename the current
Filter
type toCommitFilter
, in order to allow the creation of aBranchFIlter
Binding the following method might also be helpful. Related libgit2 tests can be found here.
/**
* Find a merge base between two commits
*
* @param out the OID of a merge base between 'one' and 'two'
* @param repo the repository where the commits exist
* @param one one of the commits
* @param two the other commit
*/
GIT_EXTERN(int) git_merge_base(
git_oid *out,
git_repository *repo,
git_oid *one,
git_oid *two);