diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2022-11-29 07:02:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-29 07:02:11 +0100 |
commit | 0966a009e12e0ebd5a84a181422c63c97929739a (patch) | |
tree | a8d7351b3d6094cea5974750a312346f1c066e0a /plumbing/format/index/decoder.go | |
parent | c798d4a42004b1c8976a6a4f42f131f16d08b6fa (diff) | |
parent | 7c37589e95f6a88e470bf91d3a0ef8536702f3f4 (diff) | |
download | go-git-0966a009e12e0ebd5a84a181422c63c97929739a.tar.gz |
Merge pull request #618 from fluxcd/collision_detection
sha1: Add collision resistent implementation
Diffstat (limited to 'plumbing/format/index/decoder.go')
-rw-r--r-- | plumbing/format/index/decoder.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/format/index/decoder.go b/plumbing/format/index/decoder.go index 036b636..c4da20c 100644 --- a/plumbing/format/index/decoder.go +++ b/plumbing/format/index/decoder.go @@ -3,15 +3,15 @@ package index import ( "bufio" "bytes" - "crypto/sha1" + "crypto" "errors" - "hash" "io" "io/ioutil" "strconv" "time" "github.com/go-git/go-git/v5/plumbing" + "github.com/go-git/go-git/v5/plumbing/hash" "github.com/go-git/go-git/v5/utils/binary" ) @@ -49,7 +49,7 @@ type Decoder struct { // NewDecoder returns a new decoder that reads from r. func NewDecoder(r io.Reader) *Decoder { - h := sha1.New() + h := hash.New(crypto.SHA1) return &Decoder{ r: io.TeeReader(r, h), hash: h, |