From 6931d33dc40b5b4a06e3c556bf0891e24d74d95e Mon Sep 17 00:00:00 2001 From: Tony <1094086026@qq.com> Date: Wed, 27 May 2026 20:25:55 +0800 Subject: [PATCH] fix: use correct error variable in stderr copy check In gitServiceHandler, the stderr io.Copy goroutine checked the outer scope variable 'err' instead of the local 'erro' from the copy operation. This caused stderr copy errors to be silently swallowed when the outer err was nil, and incorrectly triggered when the outer err was non-nil. Change the condition from 'err != nil' to 'erro != nil' to properly detect and log stderr copy failures. --- pkg/git/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/git/service.go b/pkg/git/service.go index a4066d07e..d50cffbc6 100644 --- a/pkg/git/service.go +++ b/pkg/git/service.go @@ -147,7 +147,7 @@ func gitServiceHandler(ctx context.Context, svc Service, scmd ServiceCommand) er wg.Add(1) go func() { defer wg.Done() - if _, erro := io.Copy(scmd.Stderr, stderr); err != nil { + if _, erro := io.Copy(scmd.Stderr, stderr); erro != nil { log.Errorf("gitServiceHandler: failed to copy stderr: %v", erro) } }()