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

Method Rtransform

refspec.go:133–149  ·  view source on GitHub ↗

Rtransform converts a target reference to its source reference following the refspec's rules

(refname string)

Source from the content-addressed store, hash-verified

131// Rtransform converts a target reference to its source reference following the
132// refspec's rules
133func (s *Refspec) Rtransform(refname string) (string, error) {
134 buf := C.git_buf{}
135
136 cname := C.CString(refname)
137 defer C.free(unsafe.Pointer(cname))
138
139 runtime.LockOSThread()
140 defer runtime.UnlockOSThread()
141
142 ret := C.git_refspec_rtransform(&buf, s.ptr, cname)
143 if ret < 0 {
144 return "", MakeGitError(ret)
145 }
146 defer C.git_buf_dispose(&buf)
147
148 return C.GoString(buf.ptr), nil
149}

Callers 1

TestRefspecFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by 1

TestRefspecFunction · 0.64