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

Method InmemoryIndex

rebase.go:402–414  ·  view source on GitHub ↗

InmemoryIndex gets the index produced by the last operation, which is the result of `Next()` and which will be committed by the next invocation of `Commit()`. This is useful for resolving conflicts in an in-memory rebase before committing them. This is only applicable for in-memory rebases; for reb

()

Source from the content-addressed store, hash-verified

400// This is only applicable for in-memory rebases; for rebases within a working
401// directory, the changes were applied to the repository's index.
402func (rebase *Rebase) InmemoryIndex() (*Index, error) {
403 runtime.LockOSThread()
404 defer runtime.UnlockOSThread()
405
406 var ptr *C.git_index
407 err := C.git_rebase_inmemory_index(&ptr, rebase.ptr)
408 runtime.KeepAlive(rebase)
409 if err < 0 {
410 return nil, MakeGitError(err)
411 }
412
413 return newIndexFromC(ptr, rebase.r), nil
414}
415
416// Commit commits the current patch.
417// You must have resolved any conflicts that were introduced during the patch application from the Next() invocation.

Callers 1

Calls 2

MakeGitErrorFunction · 0.85
newIndexFromCFunction · 0.85

Tested by 1