mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Drop the git config cache when getting focus
This allows changing git config values while lazygit is running (e.g. in a different terminal tab, or even in lazygit's ":" shell prompt), and have them take effect immediately, while still getting some benefit from caching them while lazygit is in the foreground.
This commit is contained in:
parent
f98ad65f46
commit
3e15be576e
4 changed files with 18 additions and 0 deletions
|
@ -331,6 +331,8 @@ func (gui *Gui) onNewRepo(startArgs appTypes.StartArgs, contextKey types.Context
|
|||
|
||||
gui.g.SetFocusHandler(func(Focused bool) error {
|
||||
if Focused {
|
||||
gui.git.Config.DropConfigCache()
|
||||
|
||||
oldConfig := gui.Config.GetUserConfig()
|
||||
reloadErr, didChange := gui.Config.ReloadChangedUserConfigFiles()
|
||||
if didChange && reloadErr == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue