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

Method Commit

indexer.go:78–90  ·  view source on GitHub ↗

Commit finalizes the pack and index. It resolves any pending deltas and writes out the index file. It also returns the packfile's hash. A packfile's name is derived from the sorted hashing of all object names.

()

Source from the content-addressed store, hash-verified

76// It also returns the packfile's hash. A packfile's name is derived from the
77// sorted hashing of all object names.
78func (indexer *Indexer) Commit() (*Oid, error) {
79 runtime.LockOSThread()
80 defer runtime.UnlockOSThread()
81
82 ret := C.git_indexer_commit(indexer.ptr, &indexer.stats)
83 if ret < 0 {
84 return nil, MakeGitError(ret)
85 }
86
87 id := newOidFromC(C.git_indexer_hash(indexer.ptr))
88 runtime.KeepAlive(indexer)
89 return id, nil
90}
91
92// Free frees the indexer and its resources.
93func (indexer *Indexer) Free() {

Callers 1

TestIndexerOutOfOrderFunction · 0.95

Calls 2

MakeGitErrorFunction · 0.85
newOidFromCFunction · 0.85

Tested by 1

TestIndexerOutOfOrderFunction · 0.76