Given a specific reference (a tag in this case) how can you list the branches that contain that commit in git2go? Similar to git branch --contains <commit>
.
相关问题
- Golang mongodb aggregation
- How to flatten out a nested json structure in go
- Why does recursive submodule update from github fa
- how to install private repo using glide golang
- Extended message for commit via Visual Studio Code
相关文章
- 请教Git如何克隆本地库?
- Can I run a single test in a suite?
- How to check if a request was cancelled
- Is it possible to implement an interface with unex
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
The question here, graph-wise is "how do I know if A is an ancestor of B?" (repeated a few times for each branch which you want to be B). The only way to answer that is to walk down the history graph starting at B and check if you find A.
You can do this in a few ways, but the most efficient is generally going to be to reduce the question to the equivalent "is A a merge-base of A and B?". You can ask this question in git2go via
Repository.MergeBase()
. This will return the best merge-base between the two commits you give it. In the case where you want one of the commits to be the merge base, this should always provide the right answer, even though it cuts the answer down to a single merge base.