Return 404 instead of error when commit not exist (#31977)
Fix #31976 (cherry picked from commit bf7ae0429cdf236510aa6702e499878bc2345a6e)
This commit is contained in:
parent
3c8eb46765
commit
5f3a2aafdf
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ func GetAllCommits(ctx *context.APIContext) {
|
|||
// get commit specified by sha
|
||||
baseCommit, err = ctx.Repo.GitRepo.GetCommit(sha)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetCommit", err)
|
||||
ctx.NotFoundOrServerError("GetCommit", git.IsErrNotExist, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue