summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-10-10 21:54:30 +0100
committerGitHub <noreply@github.com>2022-10-10 21:54:30 +0100
commit3ccebf7f4044b85eef975e4544785893da763bd2 (patch)
tree2e8e14e0cf4f7c0acaf6bbb4fac678e8de0919db /modules/git
parent94037ada247e8b27c7b456e1eeb9461cdb433d66 (diff)
downloadgitea-3ccebf7f4044b85eef975e4544785893da763bd2.tar.gz
gitea-3ccebf7f4044b85eef975e4544785893da763bd2.zip
Stop logging CheckPath returns error: context canceled (#21064)
We should only log CheckPath errors if they are not simply due to context cancellation - and we should add a little more context to the error message. Fix #20709 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/repo_attribute.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/git/repo_attribute.go b/modules/git/repo_attribute.go
index 1305e6f224..21ff93e498 100644
--- a/modules/git/repo_attribute.go
+++ b/modules/git/repo_attribute.go
@@ -191,8 +191,8 @@ func (c *CheckAttributeReader) Run() error {
// CheckPath check attr for given path
func (c *CheckAttributeReader) CheckPath(path string) (rs map[string]string, err error) {
defer func() {
- if err != nil {
- log.Error("CheckPath returns error: %v", err)
+ if err != nil && err != c.ctx.Err() {
+ log.Error("Unexpected error when checking path %s in %s. Error: %v", path, c.Repo.Path, err)
}
}()