summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-27 16:02:20 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 17:42:07 +1000
commite8738161603b5d9844f690214cee7e570a93d5a1 (patch)
treec0ea40ea6a3d9a602bb46ec09e1de41aeea75f09 /pkg/gui
parent23626755d7d4ae3573d25ad73db7bf5be0c495f2 (diff)
do not include bare repos in recent repos list
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/recent_repos_panel.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/gui/recent_repos_panel.go b/pkg/gui/recent_repos_panel.go
index dba8ac260..6d9e535a3 100644
--- a/pkg/gui/recent_repos_panel.go
+++ b/pkg/gui/recent_repos_panel.go
@@ -45,6 +45,14 @@ func (gui *Gui) handleCreateRecentReposMenu() error {
// updateRecentRepoList registers the fact that we opened lazygit in this repo,
// so that we can open the same repo via the 'recent repos' menu
func (gui *Gui) updateRecentRepoList() error {
+ if gui.GitCommand.IsBareRepo() {
+ // we could totally do this but it would require storing both the git-dir and the
+ // worktree in our recent repos list, which is a change that would need to be
+ // backwards compatible
+ gui.Log.Info("Not appending bare repo to recent repo list")
+ return nil
+ }
+
recentRepos := gui.Config.GetAppState().RecentRepos
currentRepo, err := os.Getwd()
if err != nil {