1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-02 09:21:40 +02:00

use GetBool instead of casting

This commit is contained in:
Francisco Miamoto 2020-08-30 11:31:19 -03:00 committed by Jesse Duffield
parent 70eda031dc
commit 250fe740b2

View File

@ -517,7 +517,7 @@ func (gui *Gui) pushWithForceFlag(v *gocui.View, force bool, upstream string, ar
branchName := gui.getCheckedOutBranch().Name
err := gui.GitCommand.Push(branchName, force, upstream, args, gui.promptUserForCredential)
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 {
gui.createErrorPanel(gui.Tr.SLocalize("UpdatesRejectedAndForcePushDisabled"))
return
@ -568,7 +568,7 @@ func (gui *Gui) pushFiles(g *gocui.Gui, v *gocui.View) error {
return gui.pushWithForceFlag(v, false, "", "")
}
forcePushDisabled := gui.Config.GetUserConfig().Get("git.disableForcePushing").(bool)
forcePushDisabled := gui.Config.GetUserConfig().GetBool("git.disableForcePushing")
if forcePushDisabled {
return gui.createErrorPanel(gui.Tr.SLocalize("ForcePushDisabled"))
}