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

Function newRevspecFromC

revparse.go:41–58  ·  view source on GitHub ↗
(ptr *C.git_revspec, repo *Repository)

Source from the content-addressed store, hash-verified

39}
40
41func newRevspecFromC(ptr *C.git_revspec, repo *Repository) *Revspec {
42 var to *Object
43 var from *Object
44
45 if ptr.to != nil {
46 to = allocObject(ptr.to, repo)
47 }
48
49 if ptr.from != nil {
50 from = allocObject(ptr.from, repo)
51 }
52
53 return &Revspec{
54 to: to,
55 from: from,
56 flags: RevparseFlag(ptr.flags),
57 }
58}
59
60func (r *Repository) Revparse(spec string) (*Revspec, error) {
61 cspec := C.CString(spec)

Callers 1

RevparseMethod · 0.85

Calls 2

allocObjectFunction · 0.85
RevparseFlagTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…