mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-17 06:58:25 +00:00
Refactor git command stderr handling (#36402)
And clean up legacy fragile & incorrect logic
This commit is contained in:
1 parent
fafd1db19e
commit
72be55f7d3
69 files changed
+345
-627
No files matched your search
@@ -22,17 +22,11 @@ func (repo *Repository) GetRefsFiltered(pattern string) ([]*Reference, error) {
|
||||
}()
|
||||
|
||||
go func() {
|
||||
stderrBuilder := &strings.Builder{}
|
||||
err := gitcmd.NewCommand("for-each-ref").
|
||||
WithDir(repo.Path).
|
||||
WithStdout(stdoutWriter).
|
||||
WithStderr(stderrBuilder).
|
||||
Run(repo.Ctx)
|
||||
if err != nil {
|
||||
_ = stdoutWriter.CloseWithError(gitcmd.ConcatenateError(err, stderrBuilder.String()))
|
||||
} else {
|
||||
_ = stdoutWriter.Close()
|
||||
}
|
||||
_ = stdoutWriter.CloseWithError(err)
|
||||
}()
|
||||
|
||||
refs := make([]*Reference, 0)
|
||||
|
||||
Reference in new issue
Block a user