diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-11-02 12:20:22 +0100 |
---|---|---|
committer | Gusted <postmaster@gusted.xyz> | 2024-11-03 16:47:44 +0100 |
commit | 171de4d107bece9d923c2455dff579aa7cd31ecf (patch) | |
tree | 7a7242e28e9bbe4ce1e09e0fb26ad440236ce35c /routers/web | |
parent | Merge pull request 'chore(cleanup): remove unused TestCreateFile' (#5788) fro... (diff) | |
download | forgejo-171de4d107bece9d923c2455dff579aa7cd31ecf.tar.xz forgejo-171de4d107bece9d923c2455dff579aa7cd31ecf.zip |
[PORT] Fix git error handling (gitea#32401)
---
Conflict resolution: Trivial, for `repo_attributes.go` move where the
`IsErrCanceledOrKilled` needs to happen because of other changes that
happened in this file.
To add some words to this change: It seems to be mostly simplifying the
error handling of git operations.
(cherry picked from commit e524f63d58900557d7d57fc3bcd19d9facc8b8ee)
Diffstat (limited to 'routers/web')
-rw-r--r-- | routers/web/repo/githttp.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/githttp.go b/routers/web/repo/githttp.go index a082498dfd..c1adca174f 100644 --- a/routers/web/repo/githttp.go +++ b/routers/web/repo/githttp.go @@ -467,7 +467,7 @@ func serviceRPC(ctx *context.Context, h *serviceHandler, service string) { Stderr: &stderr, UseContextTimeout: true, }); err != nil { - if err.Error() != "signal: killed" { + if !git.IsErrCanceledOrKilled(err) { log.Error("Fail to serve RPC(%s) in %s: %v - %s", service, h.getRepoDir(), err, stderr.String()) } return |