diff options
Diffstat (limited to 'routers/repo/commit.go')
-rw-r--r-- | routers/repo/commit.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go index c102ceae..0dc0ceba 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -152,7 +152,11 @@ func Diff(ctx *context.Context) { commit, err := ctx.Repo.GitRepo.GetCommit(commitID) if err != nil { - ctx.Handle(500, "Repo.GitRepo.GetCommit", err) + if git.IsErrNotExist(err) { + ctx.Handle(404, "Repo.GitRepo.GetCommit", err) + } else { + ctx.Handle(500, "Repo.GitRepo.GetCommit", err) + } return } |