Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop logging CheckPath returns error: context canceled #21064

Merged
4 changes: 2 additions & 2 deletions modules/git/repo_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 returns error: %v", path, c.Repo.Path, err)
zeripath marked this conversation as resolved.
Show resolved Hide resolved
}
}()

Expand Down
2 changes: 0 additions & 2 deletions services/gitdiff/gitdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,8 +1178,6 @@ func GetDiff(gitRepo *git.Repository, opts *DiffOptions, files ...string) (*Diff
} else if language, has := attrs["gitlab-language"]; has && language != "unspecified" && language != "" {
diffFile.Language = language
}
} else {
log.Error("Unexpected error: %v", err)
zeripath marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down