Refactor git command context & pipeline (#36406)

Less and simpler code, fewer bugs
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-01-21 01:35:14 +00:00
1 parent f6db180a80
commit 9ea91e036f
36 files changed
+286 -434

No files matched your search

+3 -3
View File
@@ -447,9 +447,9 @@ func serviceRPC(ctx *context.Context, service string) {
if err := gitrepo.RunCmdWithStderr(ctx, h.getStorageRepo(), cmd.AddArguments(".").
WithEnv(append(os.Environ(), h.environ...)).
WithStdin(reqBody).
WithStdout(ctx.Resp).
WithUseContextTimeout(true)); err != nil {
if !git.IsErrCanceledOrKilled(err) {
WithStdout(ctx.Resp),
); err != nil {
if !gitcmd.IsErrorCanceledOrKilled(err) {
log.Error("Fail to serve RPC(%s) in %s: %v", service, h.getStorageRepo().RelativePath(), err)
}
}