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

Method Cherrypick

cherrypick.go:59–77  ·  view source on GitHub ↗
(commit *Commit, opts CherrypickOptions)

Source from the content-addressed store, hash-verified

57}
58
59func (v *Repository) Cherrypick(commit *Commit, opts CherrypickOptions) error {
60 runtime.LockOSThread()
61 defer runtime.UnlockOSThread()
62
63 var err error
64 cOpts := populateCherrypickOptions(&C.git_cherrypick_options{}, &opts, &err)
65 defer freeCherrypickOpts(cOpts)
66
67 ret := C.git_cherrypick(v.ptr, commit.cast_ptr, cOpts)
68 runtime.KeepAlive(v)
69 runtime.KeepAlive(commit)
70 if ret == C.int(ErrorCodeUser) && err != nil {
71 return err
72 }
73 if ret < 0 {
74 return MakeGitError(ret)
75 }
76 return nil
77}
78
79func (r *Repository) CherrypickCommit(pick, our *Commit, opts CherrypickOptions) (*Index, error) {
80 runtime.LockOSThread()

Callers 1

TestCherrypickFunction · 0.80

Calls 3

freeCherrypickOptsFunction · 0.85
MakeGitErrorFunction · 0.85

Tested by 1

TestCherrypickFunction · 0.64