Reputation: 186
I'm trying to know how I can get the branch in which a commit was created in (not the head). I know a branch is just a 'tag' attached to a commit (the head of that branch)
For example, in this image, what would I need to do to get the branch of the node E using nodegit or another git library.
I looked in the documentation, but I didn't find an equivalent to git branch --contains
Thanks !
Upvotes: 3
Views: 676
Reputation: 938
You'd have to:
NodeGit.Merge.base(repository, branchTip, interestedCommit)
.returnedCommit === interestedCommit
then you're fineUpvotes: 1