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

Method NewReferenceIteratorGlob

reference.go:412–426  ·  view source on GitHub ↗

NewReferenceIteratorGlob creates an iterator over reference names that match the speicified glob. The glob is of the usual fnmatch type.

(glob string)

Source from the content-addressed store, hash-verified

410// that match the speicified glob. The glob is of the usual fnmatch
411// type.
412func (repo *Repository) NewReferenceIteratorGlob(glob string) (*ReferenceIterator, error) {
413 cstr := C.CString(glob)
414 defer C.free(unsafe.Pointer(cstr))
415 var ptr *C.git_reference_iterator
416
417 runtime.LockOSThread()
418 defer runtime.UnlockOSThread()
419
420 ret := C.git_reference_iterator_glob_new(&ptr, repo.ptr, cstr)
421 if ret < 0 {
422 return nil, MakeGitError(ret)
423 }
424
425 return newReferenceIteratorFromC(ptr, repo), nil
426}
427
428func (i *ReferenceIterator) Names() *ReferenceNameIterator {
429 return &ReferenceNameIterator{ReferenceIterator: i}

Callers

nothing calls this directly

Calls 3

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected