1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-20 17:22:23 +03:00

Trigger immediate background fetch when switching repos

This commit is contained in:
Stefan Haller
2025-11-16 09:10:54 +01:00
parent 8f4bf49aff
commit aff6b642ea
3 changed files with 41 additions and 13 deletions

View File

@@ -305,6 +305,14 @@ func (self *GuiRepoState) GetSplitMainPanel() bool {
return self.SplitMainPanel
}
func (gui *Gui) onSwitchToNewRepo(startArgs appTypes.StartArgs, contextKey types.ContextKey) error {
err := gui.onNewRepo(startArgs, contextKey)
if err == nil && gui.UserConfig().Git.AutoFetch && gui.UserConfig().Refresher.FetchInterval > 0 {
gui.BackgroundRoutineMgr.triggerImmediateFetch()
}
return err
}
func (gui *Gui) onNewRepo(startArgs appTypes.StartArgs, contextKey types.ContextKey) error {
var err error
gui.git, err = commands.NewGitCommand(