diff --git a/pkg/builder/sources/git_test.go b/pkg/builder/sources/git_test.go index beeaa94a2..b6b096320 100644 --- a/pkg/builder/sources/git_test.go +++ b/pkg/builder/sources/git_test.go @@ -36,7 +36,7 @@ func TestGitClone(t *testing.T) { Branch: "master", } //logger := event.GetManager().GetLogger("system") - res, err := GitClone(csi, "/tmp/rainbonddoc", nil, 1) + res, err := GitClone(csi, "/tmp/rainbonddoc2", nil, 1) if err != nil { t.Fatal(err) } diff --git a/vendor/gopkg.in/src-d/go-git.v4/plumbing/format/packfile/scanner.go b/vendor/gopkg.in/src-d/go-git.v4/plumbing/format/packfile/scanner.go index d2d776f6e..0c5280d15 100644 --- a/vendor/gopkg.in/src-d/go-git.v4/plumbing/format/packfile/scanner.go +++ b/vendor/gopkg.in/src-d/go-git.v4/plumbing/format/packfile/scanner.go @@ -64,8 +64,8 @@ func NewScanner(r io.Reader) *Scanner { crc := crc32.NewIEEE() return &Scanner{ r: &teeReader{ - newByteReadSeeker(seeker), - crc, + reader: newByteReadSeeker(seeker), + w: crc, }, crc: crc, IsSeekable: ok, @@ -400,7 +400,8 @@ type reader interface { type teeReader struct { reader - w hash.Hash32 + w hash.Hash32 + buf [1]byte } func (r *teeReader) Read(p []byte) (n int, err error) { @@ -416,7 +417,8 @@ func (r *teeReader) Read(p []byte) (n int, err error) { func (r *teeReader) ReadByte() (b byte, err error) { b, err = r.reader.ReadByte() if err == nil { - _, err := r.w.Write([]byte{b}) + r.buf[0] = b + _, err := r.w.Write(r.buf[:]) if err != nil { return 0, err }