diff options
| author | 2025-11-16 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-16 00:00:00 +0000 | |
| commit | 3bde7664e748dd648f58c0a5280612c239dc0870 (patch) | |
| tree | b16d6427a70f4e49f4c0b47eead8d420612123fb /pack_idx.go | |
| parent | Remove repo.Root (diff) | |
Unexport Repository.HashSize
Diffstat (limited to 'pack_idx.go')
| -rw-r--r-- | pack_idx.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pack_idx.go b/pack_idx.go index 7547777d..03397286 100644 --- a/pack_idx.go +++ b/pack_idx.go @@ -163,7 +163,7 @@ func (pi *packIndex) parse(buf []byte) error { nobj := int(readBE32(pi.fanout[len(pi.fanout)-4:])) namesStart := fanoutEnd - namesEnd := namesStart + nobj*pi.repo.HashSize + namesEnd := namesStart + nobj*pi.repo.hashSize if namesEnd > len(buf) { return ErrInvalidObject } @@ -183,7 +183,7 @@ func (pi *packIndex) parse(buf []byte) error { pi.offset32 = buf[off32Start:off32End] off64Start := off32End - trailerStart := len(buf) - 2*pi.repo.HashSize + trailerStart := len(buf) - 2*pi.repo.hashSize if trailerStart < off64Start { return ErrInvalidObject } @@ -245,8 +245,8 @@ func (pi *packIndex) lookup(id Hash) (packlocation, error) { return packlocation{}, err } // Verify hash size matches repository hash size - if id.size != pi.repo.HashSize { - return packlocation{}, fmt.Errorf("furgit: hash size mismatch: got %d, expected %d", id.size, pi.repo.HashSize) + if id.size != pi.repo.hashSize { + return packlocation{}, fmt.Errorf("furgit: hash size mismatch: got %d, expected %d", id.size, pi.repo.hashSize) } first := int(id.data[0]) var lo int @@ -254,7 +254,7 @@ func (pi *packIndex) lookup(id Hash) (packlocation, error) { lo = int(pi.fanoutEntry(first - 1)) } hi := int(pi.fanoutEntry(first)) - idx, found := bsearchHash(pi.names, pi.repo.HashSize, lo, hi, id) + idx, found := bsearchHash(pi.names, pi.repo.hashSize, lo, hi, id) if !found { return packlocation{}, ErrNotFound } |
