MCPcopy
hub / github.com/go-git/go-git / decodeLEB128ByteReader

Function decodeLEB128ByteReader

plumbing/format/packfile/patch_delta.go:464–485  ·  view source on GitHub ↗
(input io.ByteReader)

Source from the content-addressed store, hash-verified

462}
463
464func decodeLEB128ByteReader(input io.ByteReader) (uint, error) {
465 var num, sz uint
466 for {
467 if sz*7 > uintBits-7 {
468 return 0, ErrLengthOverflow
469 }
470
471 b, err := input.ReadByte()
472 if err != nil {
473 return 0, err
474 }
475
476 num |= (uint(b) & payload) << (sz * 7) // concats 7 bits chunks
477 sz++
478
479 if uint(b)&continuation == 0 {
480 break
481 }
482 }
483
484 return num, nil
485}
486
487func isCopyFromSrc(cmd byte) bool {
488 return (cmd & continuation) != 0

Callers 4

ReaderFromDeltaFunction · 0.85
patchDeltaWriterFunction · 0.85

Calls 1

ReadByteMethod · 0.80

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…