Fix git error handling (#32401)

This commit is contained in:
wxiaoguang 2024-11-02 19:20:22 +08:00 committed by GitHub
parent 13a203828c
commit e524f63d58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 35 additions and 89 deletions

View file

@ -1162,7 +1162,7 @@ func GetDiff(ctx context.Context, gitRepo *git.Repository, opts *DiffOptions, fi
Dir: repoPath,
Stdout: writer,
Stderr: stderr,
}); err != nil && err.Error() != "signal: killed" {
}); err != nil && !git.IsErrCanceledOrKilled(err) {
log.Error("error during GetDiff(git diff dir: %s): %v, stderr: %s", repoPath, err, stderr.String())
}