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

Method WriteTreeTo

index.go:387–401  ·  view source on GitHub ↗
(repo *Repository)

Source from the content-addressed store, hash-verified

385}
386
387func (v *Index) WriteTreeTo(repo *Repository) (*Oid, error) {
388 oid := new(Oid)
389
390 runtime.LockOSThread()
391 defer runtime.UnlockOSThread()
392
393 ret := C.git_index_write_tree_to(oid.toC(), v.ptr, repo.ptr)
394 runtime.KeepAlive(v)
395 runtime.KeepAlive(repo)
396 if ret < 0 {
397 return nil, MakeGitError(ret)
398 }
399
400 return oid, nil
401}
402
403// ReadTree replaces the contents of the index with those of the given
404// tree

Callers 10

commitSomethingFunction · 0.95
TestIndexReadTreeFunction · 0.95
TestIndexWriteTreeToFunction · 0.95
TestApplyDiffAddfileFunction · 0.80
TestApplyToTreeFunction · 0.80
addAndGetTreeFunction · 0.80
TestIndexAddFromBufferFunction · 0.80
TestIndexAddAllCallbackFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
toCMethod · 0.45

Tested by 10

commitSomethingFunction · 0.76
TestIndexReadTreeFunction · 0.76
TestIndexWriteTreeToFunction · 0.76
TestApplyDiffAddfileFunction · 0.64
TestApplyToTreeFunction · 0.64
addAndGetTreeFunction · 0.64
TestIndexAddFromBufferFunction · 0.64
TestIndexAddAllCallbackFunction · 0.64