From cd9111837e3e331cc0da7e52f8a0be9af266c7f5 Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Mon, 26 Dec 2022 23:43:08 +0900 Subject: feat: add `GitVersion` struct --- pkg/gui/gui.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pkg/gui/gui.go') 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{}, -- cgit v1.2.3