Exemple #1
0
func TreeFromIndex(repo *Repo, index *Index) (*Oid, error) {
	oid := NewOid()
	ecode := C.git_tree_create_fromindex(oid.git_oid, index.git_index)
	if ecode < GIT_SUCCESS {
		return nil, LastError()
	}
	return oid, nil
}
Exemple #2
0
func (idx *Index) CreateTree() (*Oid, error) {
	oid := new(Oid)
	oid.git_oid = new(C.git_oid)
	ecode := C.git_tree_create_fromindex(oid.git_oid, idx.git_index)
	if ecode != git_SUCCESS {
		return nil, gitError()
	}
	return oid, nil
}