MCPcopy Index your code
hub / github.com/go-git/go-git / hasObject

Method hasObject

storage/filesystem/dotgit/dotgit.go:507–523  ·  view source on GitHub ↗
(h plumbing.Hash)

Source from the content-addressed store, hash-verified

505}
506
507func (d *DotGit) hasObject(h plumbing.Hash) error {
508 if !d.options.ExclusiveAccess {
509 return nil
510 }
511
512 err := d.genObjectList()
513 if err != nil {
514 return err
515 }
516
517 _, ok := d.objectMap[h]
518 if !ok {
519 return plumbing.ErrObjectNotFound
520 }
521
522 return nil
523}
524
525func (d *DotGit) cleanPackList() {
526 d.packMap = nil

Callers 2

ObjectMethod · 0.95
ObjectStatMethod · 0.95

Calls 1

genObjectListMethod · 0.95

Tested by

no test coverage detected