diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-02 10:34:33 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-09 14:09:53 +1100 |
commit | f503ff1ecbfda00dfa4e68e38d41aceaf9b4400c (patch) | |
tree | e113663684406ca893ebb9c223d1fddbc65abea9 /pkg/commands/loaders/commits.go | |
parent | 4a1d23dc27f61e936fb3b582f02e2bba473c3b19 (diff) |
start breaking up git struct
Diffstat (limited to 'pkg/commands/loaders/commits.go')
-rw-r--r-- | pkg/commands/loaders/commits.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/pkg/commands/loaders/commits.go b/pkg/commands/loaders/commits.go index 28bcbb3a7..cc2442c96 100644 --- a/pkg/commands/loaders/commits.go +++ b/pkg/commands/loaders/commits.go @@ -36,26 +36,22 @@ type CommitLoader struct { dotGitDir string } -type CommitLoaderGitCommand interface { - CurrentBranchName() (string, string, error) - RebaseMode() (enums.RebaseMode, error) - GetCmd() oscommands.ICmdObjBuilder - GetDotGitDir() string -} - // making our dependencies explicit for the sake of easier testing func NewCommitLoader( cmn *common.Common, - gitCommand CommitLoaderGitCommand, + cmd oscommands.ICmdObjBuilder, + dotGitDir string, + getCurrentBranchName func() (string, string, error), + getRebaseMode func() (enums.RebaseMode, error), ) *CommitLoader { return &CommitLoader{ Common: cmn, - cmd: gitCommand.GetCmd(), - getCurrentBranchName: gitCommand.CurrentBranchName, - getRebaseMode: gitCommand.RebaseMode, + cmd: cmd, + getCurrentBranchName: getCurrentBranchName, + getRebaseMode: getRebaseMode, readFile: ioutil.ReadFile, walkFiles: filepath.Walk, - dotGitDir: gitCommand.GetDotGitDir(), + dotGitDir: dotGitDir, } } |