From 17d2a9c4353252caf304733b134fb347f4af4e78 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 2 Mar 2018 02:17:04 -0500 Subject: [PATCH] vendor: update github.com/gogits/git-module --- gogs.go | 2 +- templates/.VERSION | 2 +- vendor/github.com/gogits/git-module/blob.go | 13 +++++++++---- vendor/vendor.json | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gogs.go b/gogs.go index 39830c41b..dfce9d526 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/pkg/setting" ) -const APP_VER = "0.11.34.1122" +const APP_VER = "0.11.34.0302" func init() { setting.AppVer = APP_VER diff --git a/templates/.VERSION b/templates/.VERSION index 74c7c41b6..0c287fcaa 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.11.34.1122 \ No newline at end of file +0.11.34.0302 \ No newline at end of file diff --git a/vendor/github.com/gogits/git-module/blob.go b/vendor/github.com/gogits/git-module/blob.go index 478682e71..7731226d4 100644 --- a/vendor/github.com/gogits/git-module/blob.go +++ b/vendor/github.com/gogits/git-module/blob.go @@ -18,11 +18,16 @@ type Blob struct { // Data gets content of blob all at once and wrap it as io.Reader. // This can be very slow and memory consuming for huge content. func (b *Blob) Data() (io.Reader, error) { - stdout, err := NewCommand("show", b.ID.String()).RunInDirBytes(b.repo.Path) - if err != nil { - return nil, err + stdout := new(bytes.Buffer) + stderr := new(bytes.Buffer) + + // Preallocate memory to save ~50% memory usage on big files. + stdout.Grow(int(b.Size() + 2048)) + + if err := b.DataPipeline(stdout, stderr); err != nil { + return nil, concatenateError(err, stderr.String()) } - return bytes.NewBuffer(stdout), nil + return stdout, nil } func (b *Blob) DataPipeline(stdout, stderr io.Writer) error { diff --git a/vendor/vendor.json b/vendor/vendor.json index 9b4e6a3ab..34b860fd4 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -183,10 +183,10 @@ "revisionTime": "2016-08-10T03:50:02Z" }, { - "checksumSHA1": "baBdY7sA0U60da7wfhIialHmMwU=", + "checksumSHA1": "uKdOeK8zCfl5p7pZTRiZqDO2Tns=", "path": "github.com/gogits/git-module", - "revision": "5cc36acd9bc119acc0376a4db452e8ce55451c9f", - "revisionTime": "2017-11-16T18:10:54Z" + "revision": "e76267f9b4e90e15a82189b72aae8bf1c799c52a", + "revisionTime": "2018-03-02T07:13:32Z" }, { "checksumSHA1": "GBfb+meRaVNarQavLB/bzbDoBtY=",