(local, upstream *Oid)
| 24 | } |
| 25 | |
| 26 | func (repo *Repository) AheadBehind(local, upstream *Oid) (ahead, behind int, err error) { |
| 27 | runtime.LockOSThread() |
| 28 | defer runtime.UnlockOSThread() |
| 29 | |
| 30 | var aheadT C.size_t |
| 31 | var behindT C.size_t |
| 32 | |
| 33 | ret := C.git_graph_ahead_behind(&aheadT, &behindT, repo.ptr, local.toC(), upstream.toC()) |
| 34 | runtime.KeepAlive(repo) |
| 35 | runtime.KeepAlive(local) |
| 36 | runtime.KeepAlive(upstream) |
| 37 | if ret < 0 { |
| 38 | return 0, 0, MakeGitError(ret) |
| 39 | } |
| 40 | |
| 41 | return int(aheadT), int(behindT), nil |
| 42 | } |
| 43 | |
| 44 | // ReachableFromAny returns whether a commit is reachable from any of a list of |
| 45 | // commits by following parent edges. |
nothing calls this directly
no test coverage detected