diff options
| author | 2025-11-16 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-16 00:00:00 +0000 | |
| commit | 9ac827977b8f430906110ecd2030324248fff604 (patch) | |
| tree | b0f8fdb46252bef429beb27190a2cfc0cbd42540 /refs.go | |
| parent | README: Add my Villosa instance (diff) | |
| signature | ||
Support multiple hash sizes in one build
Diffstat (limited to 'refs.go')
| -rw-r--r-- | refs.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -29,7 +29,7 @@ func (repo *Repository) resolveLooseRef(refname string) (Hash, error) { return Hash{}, err } line := strings.TrimSpace(string(data)) - id, err := ParseHash(line) + id, err := ParseHashWithSize(line, repo.HashSize) if err != nil { return Hash{}, err } @@ -55,13 +55,13 @@ func (repo *Repository) resolvePackedRef(refname string) (Hash, error) { continue } sp := bytes.IndexByte(line, ' ') - if sp != HashSize*2 { + if sp != repo.HashSize*2 { continue } name := line[sp+1:] if bytes.Equal(name, want) { hex := string(line[:sp]) - id, err := ParseHash(hex) + id, err := ParseHashWithSize(hex, repo.HashSize) if err != nil { return Hash{}, err } |
