1
1
mirror of https://github.com/go-gitea/gitea synced 2025-01-08 00:44:26 +00:00

Return 404 instead of error when commit not exist ()

Fix 
This commit is contained in:
Adam Majer 2024-09-05 20:39:23 +02:00 committed by GitHub
parent 19af534462
commit bf7ae0429c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -195,7 +195,7 @@ func GetAllCommits(ctx *context.APIContext) {
// get commit specified by sha // get commit specified by sha
baseCommit, err = ctx.Repo.GitRepo.GetCommit(sha) baseCommit, err = ctx.Repo.GitRepo.GetCommit(sha)
if err != nil { if err != nil {
ctx.Error(http.StatusInternalServerError, "GetCommit", err) ctx.NotFoundOrServerError("GetCommit", git.IsErrNotExist, err)
return return
} }
} }