1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-25 12:24:47 +02:00

Worktrees should not be filtered out

But non-git directories should
This commit is contained in:
Luka Markušić 2022-06-17 21:20:37 +02:00
parent c26650258d
commit 9c6239df3d
2 changed files with 2 additions and 2 deletions

View File

@ -148,7 +148,7 @@ func isGitVersionValid(versionStr string) bool {
func isDirectoryAGitRepository(dir string) (bool, error) { func isDirectoryAGitRepository(dir string) (bool, error) {
info, err := os.Stat(filepath.Join(dir, ".git")) info, err := os.Stat(filepath.Join(dir, ".git"))
return info != nil && info.IsDir(), err return info != nil, err
} }
func (app *App) setupRepo() (bool, error) { func (app *App) setupRepo() (bool, error) {

View File

@ -110,7 +110,7 @@ func newRecentReposList(recentRepos []string, currentRepo string) (bool, []strin
newRepos := []string{currentRepo} newRepos := []string{currentRepo}
for _, repo := range recentRepos { for _, repo := range recentRepos {
if repo != currentRepo { if repo != currentRepo {
if _, err := os.Stat(repo); err != nil { if _, err := os.Stat(filepath.Join(repo, ".git")); err != nil {
continue continue
} }
newRepos = append(newRepos, repo) newRepos = append(newRepos, repo)