diff options
author | Adam Majer <amajer@suse.com> | 2024-09-05 20:39:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 02:39:23 +0800 |
commit | bf7ae0429cdf236510aa6702e499878bc2345a6e (patch) | |
tree | 4238f06e9ef0bbd1f140d727a3274030eb67e38c | |
parent | 19af5344623ba999f418520fad1a3bde77980561 (diff) | |
download | gitea-bf7ae0429cdf236510aa6702e499878bc2345a6e.tar.gz gitea-bf7ae0429cdf236510aa6702e499878bc2345a6e.zip |
Return 404 instead of error when commit not exist (#31977)
Fix #31976
-rw-r--r-- | routers/api/v1/repo/commits.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/commits.go b/routers/api/v1/repo/commits.go index d33be9d80a..cec7c3d534 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 } } |