1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

more logging of commands

This commit is contained in:
Jesse Duffield
2021-04-10 16:25:45 +10:00
parent bfad972f0c
commit 74320f0075
5 changed files with 43 additions and 14 deletions

View File

@ -84,6 +84,13 @@ func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.
}
func (c *GitCommand) WithSpan(span string) *GitCommand {
// sometimes .WithSpan(span) will be called where span actually is empty, in
// which case we don't need to log anything so we can just return early here
// with the original struct
if span == "" {
return c
}
newGitCommand := &GitCommand{}
*newGitCommand = *c
newGitCommand.OSCommand = c.OSCommand.WithSpan(span)