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

Method ReadTree

index.go:405–417  ·  view source on GitHub ↗

ReadTree replaces the contents of the index with those of the given tree

(tree *Tree)

Source from the content-addressed store, hash-verified

403// ReadTree replaces the contents of the index with those of the given
404// tree
405func (v *Index) ReadTree(tree *Tree) error {
406 runtime.LockOSThread()
407 defer runtime.UnlockOSThread()
408
409 ret := C.git_index_read_tree(v.ptr, tree.cast_ptr)
410 runtime.KeepAlive(v)
411 runtime.KeepAlive(tree)
412 if ret < 0 {
413 return MakeGitError(ret)
414 }
415
416 return nil
417}
418
419func (v *Index) WriteTree() (*Oid, error) {
420 oid := new(Oid)

Callers 1

TestIndexReadTreeFunction · 0.95

Calls 1

MakeGitErrorFunction · 0.85

Tested by 1

TestIndexReadTreeFunction · 0.76