MCPcopy Create free account
hub / github.com/go-git/go-git / hasObject

Method hasObject

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

Source from the content-addressed store, hash-verified

498}
499
500func (d *DotGit) hasObject(h plumbing.Hash) error {
501 if !d.options.ExclusiveAccess {
502 return nil
503 }
504
505 err := d.genObjectList()
506 if err != nil {
507 return err
508 }
509
510 _, ok := d.objectMap[h]
511 if !ok {
512 return plumbing.ErrObjectNotFound
513 }
514
515 return nil
516}
517
518func (d *DotGit) cleanPackList() {
519 d.packMap = nil

Callers 2

ObjectMethod · 0.95
ObjectStatMethod · 0.95

Calls 1

genObjectListMethod · 0.95

Tested by

no test coverage detected