From 6a445f7e7ebafa4ae6d104f94edb8b238abd353d Mon Sep 17 00:00:00 2001 From: bill-rich Date: Mon, 24 Oct 2022 18:12:36 -0700 Subject: [PATCH] Copy buffer bytes --- pkg/sources/git/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go index e41db64af163..fd2afbc98e0a 100644 --- a/pkg/sources/git/git.go +++ b/pkg/sources/git/git.go @@ -406,7 +406,7 @@ func (s *Git) gitChunk(diff gitparse.Diff, fileName, email, hash, when, urlMetad SourceID: s.sourceID, SourceType: s.sourceType, SourceMetadata: metadata, - Data: newChunkBuffer.Bytes(), + Data: append([]byte{}, newChunkBuffer.Bytes()...), Verify: s.verify, } newChunkBuffer.Reset() @@ -440,7 +440,7 @@ func (s *Git) gitChunk(diff gitparse.Diff, fileName, email, hash, when, urlMetad SourceID: s.sourceID, SourceType: s.sourceType, SourceMetadata: metadata, - Data: newChunkBuffer.Bytes(), + Data: append([]byte{}, newChunkBuffer.Bytes()...), Verify: s.verify, } }