aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/commitgraph/encoder.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2022-11-29 07:02:11 +0100
committerGitHub <noreply@github.com>2022-11-29 07:02:11 +0100
commit0966a009e12e0ebd5a84a181422c63c97929739a (patch)
treea8d7351b3d6094cea5974750a312346f1c066e0a /plumbing/format/commitgraph/encoder.go
parentc798d4a42004b1c8976a6a4f42f131f16d08b6fa (diff)
parent7c37589e95f6a88e470bf91d3a0ef8536702f3f4 (diff)
downloadgo-git-0966a009e12e0ebd5a84a181422c63c97929739a.tar.gz
Merge pull request #618 from fluxcd/collision_detection
sha1: Add collision resistent implementation
Diffstat (limited to 'plumbing/format/commitgraph/encoder.go')
-rw-r--r--plumbing/format/commitgraph/encoder.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/format/commitgraph/encoder.go b/plumbing/format/commitgraph/encoder.go
index d34076f..bcf7d03 100644
--- a/plumbing/format/commitgraph/encoder.go
+++ b/plumbing/format/commitgraph/encoder.go
@@ -1,11 +1,11 @@
package commitgraph
import (
- "crypto/sha1"
- "hash"
+ "crypto"
"io"
"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"
)
@@ -17,7 +17,7 @@ type Encoder struct {
// NewEncoder returns a new stream encoder that writes to w.
func NewEncoder(w io.Writer) *Encoder {
- h := sha1.New()
+ h := hash.New(crypto.SHA1)
mw := io.MultiWriter(w, h)
return &Encoder{mw, h}
}