mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-21 22:43:27 +02:00
pass repo to struct
This commit is contained in:
parent
fdf79fdeee
commit
e4e521f58a
@ -92,7 +92,7 @@ func NewGitCommandAux(
|
|||||||
// This is admittedly messy, but allows us to test each command struct in isolation,
|
// This is admittedly messy, but allows us to test each command struct in isolation,
|
||||||
// and allows for better namespacing when compared to having every method living
|
// and allows for better namespacing when compared to having every method living
|
||||||
// on the one struct.
|
// on the one struct.
|
||||||
configCommands := git_commands.NewConfigCommands(cmn, gitConfig)
|
configCommands := git_commands.NewConfigCommands(cmn, gitConfig, repo)
|
||||||
statusCommands := git_commands.NewStatusCommands(cmn, osCommand, repo, dotGitDir)
|
statusCommands := git_commands.NewStatusCommands(cmn, osCommand, repo, dotGitDir)
|
||||||
fileLoader := loaders.NewFileLoader(cmn, cmd, configCommands)
|
fileLoader := loaders.NewFileLoader(cmn, cmd, configCommands)
|
||||||
flowCommands := git_commands.NewFlowCommands(cmn, cmd, configCommands)
|
flowCommands := git_commands.NewFlowCommands(cmn, cmd, configCommands)
|
||||||
|
@ -22,10 +22,12 @@ type ConfigCommands struct {
|
|||||||
func NewConfigCommands(
|
func NewConfigCommands(
|
||||||
common *common.Common,
|
common *common.Common,
|
||||||
gitConfig git_config.IGitConfig,
|
gitConfig git_config.IGitConfig,
|
||||||
|
repo *gogit.Repository,
|
||||||
) *ConfigCommands {
|
) *ConfigCommands {
|
||||||
return &ConfigCommands{
|
return &ConfigCommands{
|
||||||
Common: common,
|
Common: common,
|
||||||
gitConfig: gitConfig,
|
gitConfig: gitConfig,
|
||||||
|
repo: repo,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package git_commands
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/go-errors/errors"
|
"github.com/go-errors/errors"
|
||||||
|
gogit "github.com/jesseduffield/go-git/v5"
|
||||||
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
|
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
|
||||||
"github.com/jesseduffield/lazygit/pkg/commands/loaders"
|
"github.com/jesseduffield/lazygit/pkg/commands/loaders"
|
||||||
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
||||||
@ -61,7 +62,10 @@ func buildConfigCommands(deps commonDeps) *ConfigCommands {
|
|||||||
deps = completeDeps(deps)
|
deps = completeDeps(deps)
|
||||||
common := utils.NewDummyCommonWithUserConfig(deps.userConfig)
|
common := utils.NewDummyCommonWithUserConfig(deps.userConfig)
|
||||||
|
|
||||||
return NewConfigCommands(common, deps.gitConfig)
|
// TODO: think of a way to actually mock this outnil
|
||||||
|
var repo *gogit.Repository = nil
|
||||||
|
|
||||||
|
return NewConfigCommands(common, deps.gitConfig, repo)
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildOSCommand(deps commonDeps) *oscommands.OSCommand {
|
func buildOSCommand(deps commonDeps) *oscommands.OSCommand {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user