diff options
author | Paulo Gomes <pjbgf@linux.com> | 2023-03-07 23:31:29 +0000 |
---|---|---|
committer | Paulo Gomes <pjbgf@linux.com> | 2023-03-08 00:14:59 +0000 |
commit | 9822ad8573e374421a79c096d8f1dfa91366fb02 (patch) | |
tree | e3adb42646511378112cb05461bb8154f010ddee /plumbing/format/index/decoder.go | |
parent | 99e2f85843878671b028d4d01bd4668676226dd1 (diff) | |
download | go-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/index/decoder.go')
-rw-r--r-- | plumbing/format/index/decoder.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plumbing/format/index/decoder.go b/plumbing/format/index/decoder.go index c4da20c..8834e25 100644 --- a/plumbing/format/index/decoder.go +++ b/plumbing/format/index/decoder.go @@ -3,7 +3,6 @@ package index import ( "bufio" "bytes" - "crypto" "errors" "io" "io/ioutil" @@ -49,7 +48,7 @@ type Decoder struct { // NewDecoder returns a new decoder that reads from r. func NewDecoder(r io.Reader) *Decoder { - h := hash.New(crypto.SHA1) + h := hash.New(hash.CryptoType) return &Decoder{ r: io.TeeReader(r, h), hash: h, |