summaryrefslogtreecommitdiffstats
path: root/pkg/commands/loader_adapters.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/loader_adapters.go')
-rw-r--r--pkg/commands/loader_adapters.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkg/commands/loader_adapters.go b/pkg/commands/loader_adapters.go
new file mode 100644
index 000000000..166bf012d
--- /dev/null
+++ b/pkg/commands/loader_adapters.go
@@ -0,0 +1,28 @@
+package commands
+
+import (
+ "io/ioutil"
+ "path/filepath"
+
+ "github.com/jesseduffield/lazygit/pkg/commands/loaders"
+ "github.com/jesseduffield/lazygit/pkg/commands/oscommands"
+ "github.com/jesseduffield/lazygit/pkg/common"
+)
+
+// this file defines constructors for loaders, passing in all the dependencies required based on a smaller set of arguments passed in by the client.
+
+func NewCommitLoader(
+ cmn *common.Common,
+ gitCommand *GitCommand,
+ osCommand *oscommands.OSCommand,
+) *loaders.CommitLoader {
+ return loaders.NewCommitLoader(
+ cmn,
+ gitCommand.Cmd,
+ gitCommand.CurrentBranchName,
+ gitCommand.RebaseMode,
+ ioutil.ReadFile,
+ filepath.Walk,
+ gitCommand.DotGitDir,
+ )
+}