diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-16 22:49:37 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-16 22:59:58 +1000 |
commit | 4f4bb40ea689925c24b2663c3b642393c7c62fe8 (patch) | |
tree | 9367e56c10f2a536abf20eb8ea6c09ee268ef7dd /pkg/gui/gui.go | |
parent | db826b3c8795e47e3471ab76bc4bcb131892c224 (diff) |
support opening lazygit outside a git directory
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index a4c99e1c0..16c829025 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -93,6 +93,10 @@ type Gui struct { fileWatcher *fileWatcher viewBufferManagerMap map[string]*tasks.ViewBufferManager stopChan chan struct{} + + // when lazygit is opened outside a git directory we want to open to the most + // recent repo with the recent repos popup showing + showRecentRepos bool } // for now the staging panel state, unlike the other panel states, is going to be @@ -278,7 +282,7 @@ func (gui *Gui) resetState() { // for now the split view will always be on // NewGui builds a new gui handler -func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *commands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer, updater *updates.Updater, filterPath string) (*Gui, error) { +func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *commands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer, updater *updates.Updater, filterPath string, showRecentRepos bool) (*Gui, error) { gui := &Gui{ Log: log, GitCommand: gitCommand, @@ -288,6 +292,7 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *comma Updater: updater, statusManager: &statusManager{}, viewBufferManagerMap: map[string]*tasks.ViewBufferManager{}, + showRecentRepos: showRecentRepos, } gui.resetState() |