Skip to content

Commit

Permalink
Return 404 instead of error when commit not exist (#31977)
Browse files Browse the repository at this point in the history
Fix #31976
  • Loading branch information
AdamMajer authored Sep 5, 2024
1 parent 19af534 commit bf7ae04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/repo/commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit bf7ae04

Please sign in to comment.