diff options
| author | 2026-01-17 22:56:53 +0800 | |
|---|---|---|
| committer | 2026-01-17 22:56:53 +0800 | |
| commit | 7a0ab5f77917a36a87945f6a88b036b9b6ba88ee (patch) | |
| tree | 06947107af26e45bb5006276daa4b4d611f5dee2 /pack_idx.go | |
| parent | README: Clarify that the sha1 build tag is for testing only (diff) | |
| signature | No signature | |
hash: Key by algorithm, not size
Diffstat (limited to 'pack_idx.go')
| -rw-r--r-- | pack_idx.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pack_idx.go b/pack_idx.go index 68170ad3..d84bb5ec 100644 --- a/pack_idx.go +++ b/pack_idx.go @@ -244,8 +244,8 @@ func (pi *packIndex) lookup(id Hash) (packlocation, error) { if err != nil { return packlocation{}, err } - 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.algo != pi.repo.hashAlgo { + return packlocation{}, fmt.Errorf("furgit: hash algorithm mismatch: got %s, expected %s", id.algo.String(), pi.repo.hashAlgo.String()) } first := int(id.data[0]) var lo int |
