diff --git a/routers/api/v1/repo/commits.go b/routers/api/v1/repo/commits.go index d33be9d80a8..cec7c3d534c 100644 --- a/routers/api/v1/repo/commits.go +++ b/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 } }