mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
The wrapper existed to add a git-specific env var to every command. Now that that's gone, its New/NewShell/Quote methods just delegated to the inner builder. The only remaining git-specific behavior — the command runner — is attached in the constructor via CloneWithNewRunner, which already returns a complete builder, so we can return that directly and drop the wrapper struct. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
21 lines
747 B
Go
21 lines
747 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// NewGitCmdObjBuilder returns a command object builder whose runner is wrapped
|
|
// with our git-specific runner (logging, credential handling, etc.).
|
|
func NewGitCmdObjBuilder(log *logrus.Entry, innerBuilder *oscommands.CmdObjBuilder) *oscommands.CmdObjBuilder {
|
|
// We decorate the runner rather than exposing the builder's runner field:
|
|
// that field stays unexported so there's a single API for running commands
|
|
// across the codebase.
|
|
return innerBuilder.CloneWithNewRunner(func(runner oscommands.ICmdObjRunner) oscommands.ICmdObjRunner {
|
|
return &gitCmdObjRunner{
|
|
log: log,
|
|
innerRunner: runner,
|
|
}
|
|
})
|
|
}
|