1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

allow spamming the p key

This commit is contained in:
Jesse Duffield
2020-08-23 21:25:39 +10:00
committed by github-actions[bot]
parent d2d88fe64e
commit 0f7003d939
4 changed files with 10 additions and 0 deletions

View File

@ -475,6 +475,9 @@ func (gui *Gui) pullFiles(opts PullFilesOptions) error {
} }
func (gui *Gui) pullWithMode(mode string, opts PullFilesOptions) error { func (gui *Gui) pullWithMode(mode string, opts PullFilesOptions) error {
gui.State.FetchMutex.Lock()
defer gui.State.FetchMutex.Unlock()
err := gui.GitCommand.Fetch( err := gui.GitCommand.Fetch(
commands.FetchOptions{ commands.FetchOptions{
PromptUserForCredential: gui.promptUserForCredential, PromptUserForCredential: gui.promptUserForCredential,

View File

@ -165,6 +165,9 @@ func (gui *Gui) handleInfoClick(g *gocui.Gui, v *gocui.View) error {
} }
func (gui *Gui) fetch(canPromptForCredentials bool) (err error) { func (gui *Gui) fetch(canPromptForCredentials bool) (err error) {
gui.State.FetchMutex.Lock()
defer gui.State.FetchMutex.Unlock()
fetchOpts := commands.FetchOptions{} fetchOpts := commands.FetchOptions{}
if canPromptForCredentials { if canPromptForCredentials {
fetchOpts.PromptUserForCredential = gui.promptUserForCredential fetchOpts.PromptUserForCredential = gui.promptUserForCredential

View File

@ -287,6 +287,7 @@ type guiState struct {
IsRefreshingFiles bool IsRefreshingFiles bool
RefreshingFilesMutex sync.Mutex RefreshingFilesMutex sync.Mutex
RefreshingStatusMutex sync.Mutex RefreshingStatusMutex sync.Mutex
FetchMutex sync.Mutex
Searching searchingState Searching searchingState
ScreenMode int ScreenMode int
SideView *gocui.View SideView *gocui.View

View File

@ -158,6 +158,9 @@ func (gui *Gui) handleFetchRemote(g *gocui.Gui, v *gocui.View) error {
} }
return gui.WithWaitingStatus(gui.Tr.SLocalize("FetchingRemoteStatus"), func() error { return gui.WithWaitingStatus(gui.Tr.SLocalize("FetchingRemoteStatus"), func() error {
gui.State.FetchMutex.Lock()
defer gui.State.FetchMutex.Unlock()
if err := gui.GitCommand.FetchRemote(remote.Name); err != nil { if err := gui.GitCommand.FetchRemote(remote.Name); err != nil {
return err return err
} }