aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-05-27 11:15:35 -0400
committerSteve Moyer <smoyer1@selesy.com>2022-05-27 11:15:35 -0400
commit1659fed99fdfeea53fa0d1da9da4fc3f7591116b (patch)
treee9ff512a7a328734f37e4b718c08770a9dec393b
parent650c11dcb68bfe00e2d399c5e1d337cae9c1bfeb (diff)
downloadgit-bug-1659fed99fdfeea53fa0d1da9da4fc3f7591116b.tar.gz
test(778): capture stderr and stdout during tests
-rw-r--r--commands/env.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/commands/env.go b/commands/env.go
index ac7b789a..98a7e1a5 100644
--- a/commands/env.go
+++ b/commands/env.go
@@ -141,6 +141,9 @@ func loadBackendEnsureUser(env *Env) func(*cobra.Command, []string) error {
// This wrapper style is necessary because a Cobra PostE function does not run if RunE return an error.
func closeBackend(env *Env, runE func(cmd *cobra.Command, args []string) error) func(*cobra.Command, []string) error {
return func(cmd *cobra.Command, args []string) error {
+ env.err = out{Writer: cmd.ErrOrStderr()}
+ env.out = out{Writer: cmd.OutOrStdout()}
+
errRun := runE(cmd, args)
if env.backend == nil {