MCPcopy Create free account
hub / github.com/libgit2/git2go / DescendantOf

Method DescendantOf

graph.go:11–24  ·  view source on GitHub ↗
(commit, ancestor *Oid)

Source from the content-addressed store, hash-verified

9)
10
11func (repo *Repository) DescendantOf(commit, ancestor *Oid) (bool, error) {
12 runtime.LockOSThread()
13 defer runtime.UnlockOSThread()
14
15 ret := C.git_graph_descendant_of(repo.ptr, commit.toC(), ancestor.toC())
16 runtime.KeepAlive(repo)
17 runtime.KeepAlive(commit)
18 runtime.KeepAlive(ancestor)
19 if ret < 0 {
20 return false, MakeGitError(ret)
21 }
22
23 return (ret > 0), nil
24}
25
26func (repo *Repository) AheadBehind(local, upstream *Oid) (ahead, behind int, err error) {
27 runtime.LockOSThread()

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
toCMethod · 0.45

Tested by

no test coverage detected