From 9d4ff6b46512aa5261ab6218d978737a0b33359d Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Thu, 30 Dec 2021 11:35:15 +1100 Subject: [PATCH] fix logging --- pkg/commands/git.go | 2 ++ pkg/commands/oscommands/os.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index b83fa1b73..950042780 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -99,6 +99,8 @@ func (c *GitCommand) WithSpan(span string) *GitCommand { *newGitCommand = *c newGitCommand.OSCommand = c.OSCommand.WithSpan(span) + newGitCommand.Cmd = NewGitCmdObjBuilder(c.Log, newGitCommand.OSCommand.Cmd) + // NOTE: unlike the other things here which create shallow clones, this will // actually update the PatchManager on the original struct to have the new span. // This means each time we call ApplyPatch in PatchManager, we need to ensure diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index e9bf1814e..eb5a81d63 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -116,6 +116,8 @@ func (c *OSCommand) WithSpan(span string) *OSCommand { newOSCommand := &OSCommand{} *newOSCommand = *c newOSCommand.CmdLogSpan = span + newOSCommand.Cmd.logCmdObj = newOSCommand.LogCmdObj + newOSCommand.Cmd.runner = &Runner{log: c.Log, logCmdObj: newOSCommand.LogCmdObj} return newOSCommand }