mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-07-25 12:39:40 +02:00
markdown: fix treating pure number as SHA1
- Detect non-exist commit and return 404 not 500
This commit is contained in:
parent
6c8fcb3af2
commit
4a46613916
5 changed files with 13 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue