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

Method loadIdxFile

storage/filesystem/object.go:76–92  ·  view source on GitHub ↗
(h plumbing.Hash)

Source from the content-addressed store, hash-verified

74}
75
76func (s *ObjectStorage) loadIdxFile(h plumbing.Hash) (err error) {
77 f, err := s.dir.ObjectPackIdx(h)
78 if err != nil {
79 return err
80 }
81
82 defer ioutil.CheckClose(f, &err)
83
84 idxf := idxfile.NewMemoryIndex()
85 d := idxfile.NewDecoder(f)
86 if err = d.Decode(idxf); err != nil {
87 return err
88 }
89
90 s.index[h] = idxf
91 return err
92}
93
94func (s *ObjectStorage) NewEncodedObject() plumbing.EncodedObject {
95 return &plumbing.MemoryObject{}

Callers 1

requireIndexMethod · 0.95

Calls 5

DecodeMethod · 0.95
CheckCloseFunction · 0.92
NewMemoryIndexFunction · 0.92
NewDecoderFunction · 0.92
ObjectPackIdxMethod · 0.80

Tested by

no test coverage detected