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

Method Commit

rebase.go:418–445  ·  view source on GitHub ↗

Commit commits the current patch. You must have resolved any conflicts that were introduced during the patch application from the Next() invocation.

(ID *Oid, author, committer *Signature, message string)

Source from the content-addressed store, hash-verified

416// Commit commits the current patch.
417// You must have resolved any conflicts that were introduced during the patch application from the Next() invocation.
418func (rebase *Rebase) Commit(ID *Oid, author, committer *Signature, message string) error {
419 runtime.LockOSThread()
420 defer runtime.UnlockOSThread()
421
422 authorSig, err := author.toC()
423 if err != nil {
424 return err
425 }
426 defer C.git_signature_free(authorSig)
427
428 committerSig, err := committer.toC()
429 if err != nil {
430 return err
431 }
432 defer C.git_signature_free(committerSig)
433
434 cmsg := C.CString(message)
435 defer C.free(unsafe.Pointer(cmsg))
436
437 cerr := C.git_rebase_commit(ID.toC(), rebase.ptr, authorSig, committerSig, nil, cmsg)
438 runtime.KeepAlive(ID)
439 runtime.KeepAlive(rebase)
440 if cerr < 0 {
441 return MakeGitError(cerr)
442 }
443
444 return nil
445}
446
447// Finish finishes a rebase that is currently in progress once all patches have been applied.
448func (rebase *Rebase) Finish() error {

Callers 3

performRebaseOntoFunction · 0.45
TestOdbWritepackFunction · 0.45

Calls 3

MakeGitErrorFunction · 0.85
freeMethod · 0.80
toCMethod · 0.45

Tested by 3

performRebaseOntoFunction · 0.36
TestOdbWritepackFunction · 0.36