Пример #1
0
func (v *Index) Get(n int) (*IndexEntry, error) {
	p := C.git_index_get(v.git_index, C.uint(n))
	if p == nil {
		estring := fmt.Sprintf("Index %v not found, total index is %v", n, v.EntryCount())
		return nil, errors.New(estring)
	}
	//entry := (*IndexEntry)(unsafe.Pointer(p))
	return &IndexEntry{p}, nil
}
Пример #2
0
func (idx *Index) Get(n uint) *IndexEntry {
	entry := new(IndexEntry)
	entry.git_index_entry = C.git_index_get(idx.git_index, C.uint(n))
	return entry
}