Return 404 instead of error when commit not exist (#31977)

Fix #31976
pull/31924/head^2
Adam Majer 3 months ago committed by GitHub
parent 19af534462
commit bf7ae0429c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      routers/api/v1/repo/commits.go

@ -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…
Cancel
Save