summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/commits.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/commits.go')
-rw-r--r--routers/api/v1/repo/commits.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/repo/commits.go b/routers/api/v1/repo/commits.go
index 8c877285a8..a16cca0f4e 100644
--- a/routers/api/v1/repo/commits.go
+++ b/routers/api/v1/repo/commits.go
@@ -69,7 +69,11 @@ func getCommit(ctx *context.APIContext, identifier string) {
defer gitRepo.Close()
commit, err := gitRepo.GetCommit(identifier)
if err != nil {
- ctx.NotFoundOrServerError("GetCommit", git.IsErrNotExist, err)
+ if git.IsErrNotExist(err) {
+ ctx.NotFound(identifier)
+ return
+ }
+ ctx.Error(http.StatusInternalServerError, "gitRepo.GetCommit", err)
return
}