From 9a2e43bff28ac92f180109fe900a6997614ea5a8 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 9 Dec 2015 20:46:05 -0500 Subject: move out git module and #1573 send push hook --- routers/repo/download.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'routers/repo/download.go') diff --git a/routers/repo/download.go b/routers/repo/download.go index d657d9b1..3c3256b3 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) -- cgit v1.2.3