diff options
author | Unknwon <u@gogs.io> | 2018-03-02 02:17:04 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2018-03-02 02:17:04 -0500 |
commit | 17d2a9c4353252caf304733b134fb347f4af4e78 (patch) | |
tree | df6b69f91def067aef0540044f287fe0187641fc | |
parent | 6f2347fc71f17b5703a9b1f383a2d3451f88b741 (diff) |
vendor: update github.com/gogits/git-module
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | templates/.VERSION | 2 | ||||
-rw-r--r-- | vendor/github.com/gogits/git-module/blob.go | 13 | ||||
-rw-r--r-- | vendor/vendor.json | 6 |
4 files changed, 14 insertions, 9 deletions
@@ -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 74c7c41b..0c287fca 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 478682e7..7731226d 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 9b4e6a3a..34b860fd 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=", |