1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

do dependency injection up front and in one place

This commit is contained in:
Jesse Duffield
2022-01-02 10:21:32 +11:00
parent 2cb8aff940
commit 194ff1630c
9 changed files with 49 additions and 43 deletions

View File

@ -1,7 +1,6 @@
package gui
import (
"github.com/jesseduffield/lazygit/pkg/commands/loaders"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/commands/patch"
"github.com/jesseduffield/lazygit/pkg/gui/filetree"
@ -106,7 +105,7 @@ func (gui *Gui) refreshCommitFilesView() error {
to := gui.State.Panels.CommitFiles.refName
from, reverse := gui.getFromAndReverseArgsForDiff(to)
files, err := loaders.NewCommitFileLoader(gui.Common, gui.GitCommand.Cmd).GetFilesInDiff(from, to, reverse)
files, err := gui.GitCommand.Loaders.CommitFiles.GetFilesInDiff(from, to, reverse)
if err != nil {
return gui.surfaceError(err)
}