summaryrefslogtreecommitdiffstats
path: root/routers/repo/download.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-09 20:46:05 -0500
committerUnknwon <u@gogs.io>2015-12-09 20:46:05 -0500
commit9a2e43bff28ac92f180109fe900a6997614ea5a8 (patch)
tree564dbb6fb30c153e43b0e18499d80e7d93dd0bee /routers/repo/download.go
parentbd5dc626e82e18d3e619d918e579dc130edcd1fa (diff)
downloadgitea-9a2e43bff28ac92f180109fe900a6997614ea5a8.tar.gz
gitea-9a2e43bff28ac92f180109fe900a6997614ea5a8.zip
move out git module and #1573 send push hook
Diffstat (limited to 'routers/repo/download.go')
-rw-r--r--routers/repo/download.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index d657d9b18c..3c3256b388 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -8,8 +8,9 @@ import (
"io"
"path"
+ "github.com/gogits/git-shell"
+
"github.com/gogits/gogs/modules/base"
- "github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/middleware"
)
@@ -21,7 +22,7 @@ func ServeData(ctx *middleware.Context, name string, reader io.Reader) error {
}
_, isTextFile := base.IsTextFile(buf)
- if ! isTextFile {
+ if !isTextFile {
_, isImageFile := base.IsImageFile(buf)
if !isImageFile {
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
@@ -45,7 +46,7 @@ func ServeBlob(ctx *middleware.Context, blob *git.Blob) error {
func SingleDownload(ctx *middleware.Context) {
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreeName)
if err != nil {
- if err == git.ErrNotExist {
+ if git.IsErrNotExist(err) {
ctx.Handle(404, "GetBlobByPath", nil)
} else {
ctx.Handle(500, "GetBlobByPath", err)