aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/idxfile/idxfile.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-03-07 23:31:29 +0000
committerPaulo Gomes <pjbgf@linux.com>2023-03-08 00:14:59 +0000
commit9822ad8573e374421a79c096d8f1dfa91366fb02 (patch)
treee3adb42646511378112cb05461bb8154f010ddee /plumbing/format/idxfile/idxfile.go
parent99e2f85843878671b028d4d01bd4668676226dd1 (diff)
downloadgo-git-9822ad8573e374421a79c096d8f1dfa91366fb02.tar.gz
*: Support variable length plumbing.Hash
The variable length for plumbing.Hash is defined at build time, blocked by tag sha256. This approach was a trade-off between keeping backwards compatibility while making progress towards supporting SHA256 with a small amount of changes. Relates to the SHA256 implementation, defined in #706. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Diffstat (limited to 'plumbing/format/idxfile/idxfile.go')
-rw-r--r--plumbing/format/idxfile/idxfile.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plumbing/format/idxfile/idxfile.go b/plumbing/format/idxfile/idxfile.go
index 64dd8dc..9237a74 100644
--- a/plumbing/format/idxfile/idxfile.go
+++ b/plumbing/format/idxfile/idxfile.go
@@ -8,6 +8,7 @@ import (
encbin "encoding/binary"
"github.com/go-git/go-git/v5/plumbing"
+ "github.com/go-git/go-git/v5/plumbing/hash"
)
const (
@@ -53,8 +54,8 @@ type MemoryIndex struct {
Offset32 [][]byte
CRC32 [][]byte
Offset64 []byte
- PackfileChecksum [20]byte
- IdxChecksum [20]byte
+ PackfileChecksum [hash.Size]byte
+ IdxChecksum [hash.Size]byte
offsetHash map[int64]plumbing.Hash
offsetHashIsFull bool