mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent access.
This commit is contained in:
@ -210,7 +210,7 @@ func (self *SyncController) pushAux(currentBranch *models.Branch, opts pushOpts)
|
||||
return errors.New(self.c.Tr.UpdatesRejected)
|
||||
}
|
||||
|
||||
forcePushDisabled := self.c.UserConfig.Git.DisableForcePushing
|
||||
forcePushDisabled := self.c.UserConfig().Git.DisableForcePushing
|
||||
if forcePushDisabled {
|
||||
return errors.New(self.c.Tr.UpdatesRejectedAndForcePushDisabled)
|
||||
}
|
||||
@ -233,7 +233,7 @@ func (self *SyncController) pushAux(currentBranch *models.Branch, opts pushOpts)
|
||||
}
|
||||
|
||||
func (self *SyncController) requestToForcePush(currentBranch *models.Branch, opts pushOpts) error {
|
||||
forcePushDisabled := self.c.UserConfig.Git.DisableForcePushing
|
||||
forcePushDisabled := self.c.UserConfig().Git.DisableForcePushing
|
||||
if forcePushDisabled {
|
||||
return errors.New(self.c.Tr.ForcePushDisabled)
|
||||
}
|
||||
@ -252,8 +252,8 @@ func (self *SyncController) forcePushPrompt() string {
|
||||
return utils.ResolvePlaceholderString(
|
||||
self.c.Tr.ForcePushPrompt,
|
||||
map[string]string{
|
||||
"cancelKey": self.c.UserConfig.Keybinding.Universal.Return,
|
||||
"confirmKey": self.c.UserConfig.Keybinding.Universal.Confirm,
|
||||
"cancelKey": self.c.UserConfig().Keybinding.Universal.Return,
|
||||
"confirmKey": self.c.UserConfig().Keybinding.Universal.Confirm,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user