Refactor git command stderr handling (#36402)

And clean up legacy fragile & incorrect logic
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-01-18 15:10:33 -08:00
1 parent fafd1db19e
commit 72be55f7d3
69 files changed
+345 -627

No files matched your search

+1 -6
View File
@@ -36,12 +36,7 @@ func CreateArchive(ctx context.Context, repo Repository, format string, target i
paths[i] = path.Clean(paths[i])
}
cmd.AddDynamicArguments(paths...)
var stderr strings.Builder
if err := RunCmd(ctx, repo, cmd.WithStdout(target).WithStderr(&stderr)); err != nil {
return gitcmd.ConcatenateError(err, stderr.String())
}
return nil
return RunCmdWithStderr(ctx, repo, cmd.WithStdout(target))
}
// CreateBundle create bundle content to the target path