1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-08 22:36:49 +02:00

Remove unused field gui.IsNewRepo

This commit is contained in:
Stefan Haller
2024-11-28 12:01:19 +01:00
parent 59303981f9
commit b07109de4d
2 changed files with 3 additions and 9 deletions

View File

@ -108,8 +108,6 @@ type Gui struct {
PopupHandler types.IPopupHandler PopupHandler types.IPopupHandler
IsNewRepo bool
IsRefreshingFiles bool IsRefreshingFiles bool
// we use this to decide whether we'll return to the original directory that // we use this to decide whether we'll return to the original directory that

View File

@ -21,8 +21,7 @@ func (gui *Gui) updateRecentRepoList() error {
if err != nil { if err != nil {
return err return err
} }
known, recentRepos := newRecentReposList(recentRepos, currentRepo) recentRepos = newRecentReposList(recentRepos, currentRepo)
gui.IsNewRepo = known
// TODO: migrate this file to use forward slashes on all OSes for consistency // TODO: migrate this file to use forward slashes on all OSes for consistency
// (windows uses backslashes at the moment) // (windows uses backslashes at the moment)
gui.c.GetAppState().RecentRepos = recentRepos gui.c.GetAppState().RecentRepos = recentRepos
@ -30,8 +29,7 @@ func (gui *Gui) updateRecentRepoList() error {
} }
// newRecentReposList returns a new repo list with a new entry but only when it doesn't exist yet // newRecentReposList returns a new repo list with a new entry but only when it doesn't exist yet
func newRecentReposList(recentRepos []string, currentRepo string) (bool, []string) { func newRecentReposList(recentRepos []string, currentRepo string) []string {
isNew := true
newRepos := []string{currentRepo} newRepos := []string{currentRepo}
for _, repo := range recentRepos { for _, repo := range recentRepos {
if repo != currentRepo { if repo != currentRepo {
@ -39,9 +37,7 @@ func newRecentReposList(recentRepos []string, currentRepo string) (bool, []strin
continue continue
} }
newRepos = append(newRepos, repo) newRepos = append(newRepos, repo)
} else {
isNew = false
} }
} }
return isNew, newRepos return newRepos
} }