Example #1
0
func (t Tree) EntryByIndex(index uint64) *TreeEntry {
	entry := C.git_tree_entry_byindex(t.cast_ptr, C.size_t(index))
	if entry == nil {
		return nil
	}

	return newTreeEntry(entry)
}
Example #2
0
func (t *Tree) EntryByIndex(index int) (*Entry, error) {
	entry := new(Entry)
	entry.git_tree_entry = C.git_tree_entry_byindex(t.git_tree, C.uint(index))
	if entry.git_tree_entry == nil {
		return nil, errors.New("Unable to find entry.")
	}
	return entry, nil
}
Example #3
0
func (tree *Tree) EntryByIndex(idx uint) *TreeEntry {
	entry := new(TreeEntry)
	entry.git_tree_entry = C.git_tree_entry_byindex(tree.git_tree, C.uint(idx))
	return entry
}