MCPcopy Create free account
hub / github.com/libgit2/git2go / ByIndex

Method ByIndex

status.go:86–98  ·  view source on GitHub ↗
(index int)

Source from the content-addressed store, hash-verified

84}
85
86func (statusList *StatusList) ByIndex(index int) (StatusEntry, error) {
87 if statusList.ptr == nil {
88 return StatusEntry{}, ErrInvalid
89 }
90 ptr := C.git_status_byindex(statusList.ptr, C.size_t(index))
91 if ptr == nil {
92 return StatusEntry{}, errors.New("index out of Bounds")
93 }
94 entry := statusEntryFromC(ptr)
95 runtime.KeepAlive(statusList)
96
97 return entry, nil
98}
99
100func (statusList *StatusList) EntryCount() (int, error) {
101 if statusList.ptr == nil {

Callers 3

checkSecondFileStagedFunction · 0.80
TestStatusListFunction · 0.80
TestStatusNothingFunction · 0.80

Calls 1

statusEntryFromCFunction · 0.85

Tested by 3

checkSecondFileStagedFunction · 0.64
TestStatusListFunction · 0.64
TestStatusNothingFunction · 0.64