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

Method padEntry

plumbing/format/index/decoder.go:197–206  ·  view source on GitHub ↗

Index entries are padded out to the next 8 byte alignment for historical reasons related to how C Git read the files.

(idx *Index, e *Entry, read int)

Source from the content-addressed store, hash-verified

195// Index entries are padded out to the next 8 byte alignment
196// for historical reasons related to how C Git read the files.
197func (d *Decoder) padEntry(idx *Index, e *Entry, read int) error {
198 if idx.Version == 4 {
199 return nil
200 }
201
202 entrySize := read + len(e.Name)
203 padLen := 8 - entrySize%8
204 _, err := io.CopyN(io.Discard, d.r, int64(padLen))
205 return err
206}
207
208func (d *Decoder) readExtensions(idx *Index) error {
209 // TODO: support 'Split index' and 'Untracked cache' extensions, take in

Callers 1

readEntryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected