1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-06 23:46:13 +02:00

Have staging refresh wait for files to refresh first

This commit is contained in:
Jesse Duffield 2023-07-29 10:20:15 +10:00
parent 63e5790410
commit 39b77c0fca

View File

@ -129,8 +129,13 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
refresh("commit files", func() { _ = self.refreshCommitFilesContext() }) refresh("commit files", func() { _ = self.refreshCommitFilesContext() })
} }
fileWg := sync.WaitGroup{}
if scopeSet.Includes(types.FILES) || scopeSet.Includes(types.SUBMODULES) { if scopeSet.Includes(types.FILES) || scopeSet.Includes(types.SUBMODULES) {
refresh("files", func() { _ = self.refreshFilesAndSubmodules() }) fileWg.Add(1)
refresh("files", func() {
_ = self.refreshFilesAndSubmodules()
fileWg.Done()
})
} }
if scopeSet.Includes(types.STASH) { if scopeSet.Includes(types.STASH) {
@ -146,7 +151,10 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
} }
if scopeSet.Includes(types.STAGING) { if scopeSet.Includes(types.STAGING) {
refresh("staging", func() { _ = self.stagingHelper.RefreshStagingPanel(types.OnFocusOpts{}) }) refresh("staging", func() {
fileWg.Wait()
_ = self.stagingHelper.RefreshStagingPanel(types.OnFocusOpts{})
})
} }
if scopeSet.Includes(types.PATCH_BUILDING) { if scopeSet.Includes(types.PATCH_BUILDING) {