diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2022-12-26 23:43:08 +0900 |
---|---|---|
committer | Ryooooooga <eial5q265e5@gmail.com> | 2022-12-30 20:01:14 +0900 |
commit | cd9111837e3e331cc0da7e52f8a0be9af266c7f5 (patch) | |
tree | 1b33e6ec8b383d4936f988bd981c3b313e59e4f2 /pkg/gui | |
parent | 41222f07edc9d55dc43a0f5b4b8f865568271ae7 (diff) |
feat: add `GitVersion` struct
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/dummies.go | 3 | ||||
-rw-r--r-- | pkg/gui/gui.go | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/pkg/gui/dummies.go b/pkg/gui/dummies.go index f0825957c..90bd094d8 100644 --- a/pkg/gui/dummies.go +++ b/pkg/gui/dummies.go @@ -1,6 +1,7 @@ package gui import ( + "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/updates" @@ -16,6 +17,6 @@ func NewDummyUpdater() *updates.Updater { func NewDummyGui() *Gui { newAppConfig := config.NewDummyAppConfig() - dummyGui, _ := NewGui(utils.NewDummyCommon(), newAppConfig, NewDummyUpdater(), false, "") + dummyGui, _ := NewGui(utils.NewDummyCommon(), newAppConfig, &git_commands.GitVersion{}, NewDummyUpdater(), false, "") return dummyGui } diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 7475476c4..4e15af94e 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -76,9 +76,10 @@ type Repo string // Gui wraps the gocui Gui object which handles rendering and events type Gui struct { *common.Common - g *gocui.Gui - git *commands.GitCommand - os *oscommands.OSCommand + g *gocui.Gui + gitVersion *git_commands.GitVersion + git *commands.GitCommand + os *oscommands.OSCommand // this is the state of the GUI for the current repo State *GuiRepoState @@ -222,6 +223,7 @@ func (gui *Gui) onNewRepo(startArgs appTypes.StartArgs, reuseState bool) error { var err error gui.git, err = commands.NewGitCommand( gui.Common, + gui.gitVersion, gui.os, git_config.NewStdCachedGitConfig(gui.Log), gui.Mutexes.SyncMutex, @@ -341,12 +343,14 @@ func initialContext(contextTree *context.ContextTree, startArgs appTypes.StartAr func NewGui( cmn *common.Common, config config.AppConfigurer, + gitVersion *git_commands.GitVersion, updater *updates.Updater, showRecentRepos bool, initialDir string, ) (*Gui, error) { gui := &Gui{ Common: cmn, + gitVersion: gitVersion, Config: config, Updater: updater, statusManager: &statusManager{}, |