mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 13:04:08 +02:00
markdown: fix treating pure number as SHA1
- Detect non-exist commit and return 404 not 500
This commit is contained in:
1 parent
6c8fcb3af2
commit
4a46613916
5 files changed
+13
-4
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user