1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-13 22:17:05 +02:00

Started working on the popup

This commit is contained in:
mjarkk 2018-12-06 08:26:05 +01:00
parent c269ad1370
commit f6e83cdbdf
5 changed files with 26 additions and 8 deletions

View File

@ -97,14 +97,14 @@ func (gui *Gui) deleteBranch(g *gocui.Gui, v *gocui.View, force bool) error {
func (gui *Gui) deleteNamedBranch(g *gocui.Gui, v *gocui.View, selectedBranch *commands.Branch, force bool) error {
title := gui.Tr.SLocalize("DeleteBranch")
var messageId string
var messageID string
if force {
messageId = "ForceDeleteBranchMessage"
messageID = "ForceDeleteBranchMessage"
} else {
messageId = "DeleteBranchMessage"
messageID = "DeleteBranchMessage"
}
message := gui.Tr.TemplateLocalize(
messageId,
messageID,
Teml{
"selectedBranchName": selectedBranch.Name,
},
@ -114,9 +114,8 @@ func (gui *Gui) deleteNamedBranch(g *gocui.Gui, v *gocui.View, selectedBranch *c
errMessage := err.Error()
if !force && strings.Contains(errMessage, "is not fully merged") {
return gui.deleteNamedBranch(g, v, selectedBranch, true)
} else {
return gui.createErrorPanel(g, errMessage)
}
return gui.createErrorPanel(g, errMessage)
}
return gui.refreshSidePanels(g)
}, nil)

View File

@ -421,9 +421,10 @@ func (gui *Gui) Run() error {
}
go func() {
time.Sleep(time.Second * 60)
err := gui.fetch(g, false)
if err == nil || !strings.Contains(err.Error(), "exit status 128") {
if err != nil && strings.Contains(err.Error(), "exit status 128") {
gui.createConfirmationPanel(g, g.CurrentView(), gui.Tr.SLocalize("NoAutomaticGitFetchTitle"), gui.Tr.SLocalize("NoAutomaticGitFetchBody"), nil, nil)
} else {
gui.goEvery(g, time.Second*60, func(g *gocui.Gui) error {
return gui.fetch(g, false)
})

View File

@ -415,6 +415,12 @@ func addDutch(i18nObject *i18n.Bundle) error {
}, &i18n.Message{
ID: "fetch",
Other: `fetch`,
}, &i18n.Message{
ID: "NoAutomaticGitFetchTitle",
Other: `No automatic git fetch`,
}, &i18n.Message{
ID: "NoAutomaticGitFetchBody",
Other: `Lazygit can't use "git fetch" in a private repo use f in the branch panel to run git fetch manually`,
},
)
}

View File

@ -423,6 +423,12 @@ func addEnglish(i18nObject *i18n.Bundle) error {
}, &i18n.Message{
ID: "fetch",
Other: `fetch`,
}, &i18n.Message{
ID: "NoAutomaticGitFetchTitle",
Other: `No automatic git fetch`,
}, &i18n.Message{
ID: "NoAutomaticGitFetchBody",
Other: `Lazygit can't use "git fetch" in a private repo use f in the branch panel to run git fetch manually`,
},
)
}

View File

@ -398,6 +398,12 @@ func addPolish(i18nObject *i18n.Bundle) error {
}, &i18n.Message{
ID: "fetch",
Other: `fetch`,
}, &i18n.Message{
ID: "NoAutomaticGitFetchTitle",
Other: `No automatic git fetch`,
}, &i18n.Message{
ID: "NoAutomaticGitFetchBody",
Other: `Lazygit can't use "git fetch" in a private repo use f in the branch panel to run git fetch manually`,
},
)
}