Пример #1
0
func (idx *Index) ReadTree(tree *Tree) error {
	ecode := C.git_index_read_tree(idx.git_index, tree.git_tree)
	if ecode != git_SUCCESS {
		return gitError()
	}
	return nil
}
Пример #2
0
// ReadTree replaces the contents of the index with those of the given
// tree
func (v *Index) ReadTree(tree *Tree) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_index_read_tree(v.ptr, tree.cast_ptr)
	if ret < 0 {
		return MakeGitError(ret)
	}

	return nil
}