mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-18 03:49:50 -06:00
Exclude the current repo from the recent repos menu by its path
The menu leaves out the first entry of the recent repos list because that's the repo we're in. This is true as long as each lazygit instance keeps its own copy of state.yml. The following commits make instances read the list from the file. The first entry is then the repo that any instance opened most recently, and that may be a different one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ad50d2fb2a
commit
9ff9479baf
1 file changed
+5
-5
@@ -280,12 +280,12 @@ func (self *ReposHelper) recentRepoMenuItem(entry recentRepoEntry, widths recent
|
||||
}
|
||||
|
||||
func (self *ReposHelper) CreateRecentReposMenu() error {
|
||||
// we'll show an empty panel if there are no recent repos
|
||||
recentRepoPaths := []string{}
|
||||
if len(self.c.GetAppState().RecentRepos) > 0 {
|
||||
// we skip the first one because we're currently in it
|
||||
recentRepoPaths = self.c.GetAppState().RecentRepos[1:]
|
||||
currentRepo, err := os.Getwd()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Don't offer the repo we're in
|
||||
recentRepoPaths := lo.Without(self.c.GetAppState().RecentRepos, currentRepo)
|
||||
|
||||
currentBranches := make([]string, len(recentRepoPaths))
|
||||
|
||||
|
||||
Reference in new issue
Block a user