示例#1
0
文件: git.go 项目: stettberger/go-git
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
}
示例#2
0
文件: tree.go 项目: jgrocho/go-git2
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
}