mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-02 23:27:32 +02:00
use GetBool instead of casting
This commit is contained in:
parent
70eda031dc
commit
250fe740b2
@ -517,7 +517,7 @@ func (gui *Gui) pushWithForceFlag(v *gocui.View, force bool, upstream string, ar
|
|||||||
branchName := gui.getCheckedOutBranch().Name
|
branchName := gui.getCheckedOutBranch().Name
|
||||||
err := gui.GitCommand.Push(branchName, force, upstream, args, gui.promptUserForCredential)
|
err := gui.GitCommand.Push(branchName, force, upstream, args, gui.promptUserForCredential)
|
||||||
if err != nil && !force && strings.Contains(err.Error(), "Updates were rejected") {
|
if err != nil && !force && strings.Contains(err.Error(), "Updates were rejected") {
|
||||||
forcePushDisabled := gui.Config.GetUserConfig().Get("git.disableForcePushing").(bool)
|
forcePushDisabled := gui.Config.GetUserConfig().GetBool("git.disableForcePushing")
|
||||||
if forcePushDisabled {
|
if forcePushDisabled {
|
||||||
gui.createErrorPanel(gui.Tr.SLocalize("UpdatesRejectedAndForcePushDisabled"))
|
gui.createErrorPanel(gui.Tr.SLocalize("UpdatesRejectedAndForcePushDisabled"))
|
||||||
return
|
return
|
||||||
@ -568,7 +568,7 @@ func (gui *Gui) pushFiles(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return gui.pushWithForceFlag(v, false, "", "")
|
return gui.pushWithForceFlag(v, false, "", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
forcePushDisabled := gui.Config.GetUserConfig().Get("git.disableForcePushing").(bool)
|
forcePushDisabled := gui.Config.GetUserConfig().GetBool("git.disableForcePushing")
|
||||||
if forcePushDisabled {
|
if forcePushDisabled {
|
||||||
return gui.createErrorPanel(gui.Tr.SLocalize("ForcePushDisabled"))
|
return gui.createErrorPanel(gui.Tr.SLocalize("ForcePushDisabled"))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user