summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-07 14:45:18 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-09 14:09:53 +1100
commit007235df2355bfeacc206b78e9827fff529d32a2 (patch)
tree3cb89ef2816119170dd69e126ace2d1bff446a2e /pkg/commands/git.go
parentf503ff1ecbfda00dfa4e68e38d41aceaf9b4400c (diff)
refactor
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 4866655e0..2f4c68fb8 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -92,6 +92,10 @@ func NewGitCommandAux(
) *GitCommand {
cmd := NewGitCmdObjBuilder(cmn.Log, osCommand.Cmd)
+ // here we're doing a bunch of dependency injection for each of our commands structs.
+ // 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
+ // on the one struct.
configCommands := NewConfigCommands(cmn, gitConfig)
statusCommands := NewStatusCommands(cmn, osCommand, repo, dotGitDir)
fileLoader := loaders.NewFileLoader(cmn, cmd, configCommands)