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

Method OpenRebase

rebase.go:325–344  ·  view source on GitHub ↗

OpenRebase opens an existing rebase that was previously started by either an invocation of InitRebase or by another client.

(opts *RebaseOptions)

Source from the content-addressed store, hash-verified

323
324// OpenRebase opens an existing rebase that was previously started by either an invocation of InitRebase or by another client.
325func (r *Repository) OpenRebase(opts *RebaseOptions) (*Rebase, error) {
326 runtime.LockOSThread()
327 defer runtime.UnlockOSThread()
328
329 var ptr *C.git_rebase
330 var err error
331 cOpts := populateRebaseOptions(&C.git_rebase_options{}, opts, r, &err)
332 ret := C.git_rebase_open(&ptr, r.ptr, cOpts)
333 runtime.KeepAlive(r)
334 if ret == C.int(ErrorCodeUser) && err != nil {
335 freeRebaseOptions(cOpts)
336 return nil, err
337 }
338 if ret < 0 {
339 freeRebaseOptions(cOpts)
340 return nil, MakeGitError(ret)
341 }
342
343 return newRebaseFromC(ptr, r, cOpts), nil
344}
345
346// OperationAt gets the rebase operation specified by the given index.
347func (rebase *Rebase) OperationAt(index uint) *RebaseOperation {

Callers 2

TestRebaseNoConflictsFunction · 0.80
TestRebaseGpgSignedFunction · 0.80

Calls 4

populateRebaseOptionsFunction · 0.85
freeRebaseOptionsFunction · 0.85
MakeGitErrorFunction · 0.85
newRebaseFromCFunction · 0.85

Tested by 2

TestRebaseNoConflictsFunction · 0.64
TestRebaseGpgSignedFunction · 0.64