git - How to list branches that contain a given commit in git2go (libgit2)? -


given specific reference (a tag in case) how can list branches contain commit in git2go? similar git branch --contains <commit>.

the question here, graph-wise "how know if ancestor of b?" (repeated few times each branch want b). way answer walk down history graph starting @ b , check if find a.

you can in few ways, efficient going to reduce question equivalent "is a merge-base of , b?". can ask question in git2go via repository.mergebase(). return best merge-base between 2 commits give it. in case want 1 of commits merge base, should provide right answer, though cuts answer down single merge base.


Comments