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.
()
| 76 | // It also returns the packfile's hash. A packfile's name is derived from the |
| 77 | // sorted hashing of all object names. |
| 78 | func (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. |
| 93 | func (indexer *Indexer) Free() { |