aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 42f3ddf4e8..7d235d84ef 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -9,7 +9,6 @@ import (
"bytes"
"errors"
"fmt"
- "io"
"io/ioutil"
"net/http"
"strconv"
@@ -363,7 +362,6 @@ func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository) []*models.
}
func getFileContentFromDefaultBranch(ctx *context.Context, filename string) (string, bool) {
- var r io.Reader
var bytes []byte
if ctx.Repo.Commit == nil {
@@ -381,10 +379,11 @@ func getFileContentFromDefaultBranch(ctx *context.Context, filename string) (str
if entry.Blob().Size() >= setting.UI.MaxDisplayFileSize {
return "", false
}
- r, err = entry.Blob().Data()
+ r, err := entry.Blob().DataAsync()
if err != nil {
return "", false
}
+ defer r.Close()
bytes, err = ioutil.ReadAll(r)
if err != nil {
return "", false