1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Optimize number of early calls to GetRepoPaths

This change reduces the number of calls during application startup to
one, calling GetRepoPaths() earlier than previously and plumbing the
repoPaths struct around to achieve this end.
This commit is contained in:
John Whitley
2024-01-29 16:58:35 -08:00
parent a138a31c72
commit 7a670964cd
6 changed files with 85 additions and 48 deletions

View File

@ -8,12 +8,7 @@ import (
// 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 {
isBareRepo, err := gui.git.Status.IsBareRepo()
if err != nil {
return err
}
if isBareRepo {
if gui.git.Status.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