aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/packfile/common.go')
-rw-r--r--plumbing/format/packfile/common.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/plumbing/format/packfile/common.go b/plumbing/format/packfile/common.go
index 728cb16..7dad1f6 100644
--- a/plumbing/format/packfile/common.go
+++ b/plumbing/format/packfile/common.go
@@ -1,7 +1,9 @@
package packfile
import (
+ "bytes"
"io"
+ "sync"
"gopkg.in/src-d/go-git.v4/plumbing/storer"
"gopkg.in/src-d/go-git.v4/utils/ioutil"
@@ -49,3 +51,9 @@ func writePackfileToObjectStorage(sw storer.PackfileWriter, packfile io.Reader)
_, err = io.Copy(w, packfile)
return err
}
+
+var bufPool = sync.Pool{
+ New: func() interface{} {
+ return bytes.NewBuffer(nil)
+ },
+}