Made some small inprovements

This commit is contained in:
mjarkk 2018-12-06 09:05:51 +01:00
parent 21a808a52b
commit 6d0fa8bc29
5 changed files with 10 additions and 11 deletions

View file

@ -34,8 +34,7 @@ func (gui *Gui) handleCreatePullRequestPress(g *gocui.Gui, v *gocui.View) error
} }
func (gui *Gui) handleGitFetch(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleGitFetch(g *gocui.Gui, v *gocui.View) error {
_ = gui.fetch(g, true) return gui.fetch(g, v, true)
return nil
} }
func (gui *Gui) handleForceCheckout(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleForceCheckout(g *gocui.Gui, v *gocui.View) error {

View file

@ -371,9 +371,9 @@ func (gui *Gui) promptAnonymousReporting() error {
}) })
} }
func (gui *Gui) fetch(g *gocui.Gui, canSskForCredentials bool) error { func (gui *Gui) fetch(g *gocui.Gui, v *gocui.View, canSskForCredentials bool) error {
err := gui.GitCommand.Fetch(func(passOrUname string) string { err := gui.GitCommand.Fetch(func(passOrUname string) string {
return gui.waitForPassUname(gui.g, gui.g.CurrentView(), passOrUname) return gui.waitForPassUname(gui.g, v, passOrUname)
}, canSskForCredentials) }, canSskForCredentials)
if canSskForCredentials && err != nil && strings.Contains(err.Error(), "exit status 128") { if canSskForCredentials && err != nil && strings.Contains(err.Error(), "exit status 128") {
@ -382,7 +382,7 @@ func (gui *Gui) fetch(g *gocui.Gui, canSskForCredentials bool) error {
close := func(g *gocui.Gui, v *gocui.View) error { close := func(g *gocui.Gui, v *gocui.View) error {
return nil return nil
} }
_ = gui.createConfirmationPanel(g, g.CurrentView(), gui.Tr.SLocalize("Error"), coloredMessage, close, close) _ = gui.createConfirmationPanel(g, v, gui.Tr.SLocalize("Error"), coloredMessage, close, close)
} }
gui.refreshStatus(g) gui.refreshStatus(g)
@ -442,12 +442,12 @@ func (gui *Gui) Run() error {
} }
go func() { go func() {
err := gui.fetch(g, false) err := gui.fetch(g, g.CurrentView(), 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) _ = gui.createConfirmationPanel(g, g.CurrentView(), gui.Tr.SLocalize("NoAutomaticGitFetchTitle"), gui.Tr.SLocalize("NoAutomaticGitFetchBody"), nil, nil)
} else { } else {
gui.goEvery(g, time.Second*60, func(g *gocui.Gui) error { gui.goEvery(g, time.Second*60, func(g *gocui.Gui) error {
return gui.fetch(g, false) return gui.fetch(g, g.CurrentView(), false)
}) })
} }
}() }()

View file

@ -417,10 +417,10 @@ func addDutch(i18nObject *i18n.Bundle) error {
Other: `fetch`, Other: `fetch`,
}, &i18n.Message{ }, &i18n.Message{
ID: "NoAutomaticGitFetchTitle", ID: "NoAutomaticGitFetchTitle",
Other: `No automatic git fetch`, Other: `Geen automatiese git fetch`,
}, &i18n.Message{ }, &i18n.Message{
ID: "NoAutomaticGitFetchBody", ID: "NoAutomaticGitFetchBody",
Other: `Lazygit can't use "git fetch" in a private repo use f in the branches panel to run git fetch manually`, Other: `Lazygit kan niet "git fetch" uitvoeren in een privé repository, gebruik f in het branches paneel om "git fetch" manueel uit te voeren`,
}, &i18n.Message{ }, &i18n.Message{
ID: "StageLines", ID: "StageLines",
Other: `stage individual hunks/lines`, Other: `stage individual hunks/lines`,

View file

@ -428,7 +428,7 @@ func addEnglish(i18nObject *i18n.Bundle) error {
Other: `No automatic git fetch`, Other: `No automatic git fetch`,
}, &i18n.Message{ }, &i18n.Message{
ID: "NoAutomaticGitFetchBody", ID: "NoAutomaticGitFetchBody",
Other: `Lazygit can't use "git fetch" in a private repo use f in the branches panel to run git fetch manually`, Other: `Lazygit can't use "git fetch" in a private repo use f in the branches panel to run "git fetch" manually`,
}, &i18n.Message{ }, &i18n.Message{
ID: "StageLines", ID: "StageLines",
Other: `stage individual hunks/lines`, Other: `stage individual hunks/lines`,

View file

@ -403,7 +403,7 @@ func addPolish(i18nObject *i18n.Bundle) error {
Other: `No automatic git fetch`, Other: `No automatic git fetch`,
}, &i18n.Message{ }, &i18n.Message{
ID: "NoAutomaticGitFetchBody", ID: "NoAutomaticGitFetchBody",
Other: `Lazygit can't use "git fetch" in a private repo use f in the branches panel to run git fetch manually`, Other: `Lazygit can't use "git fetch" in a private repo use f in the branches panel to run "git fetch" manually`,
}, &i18n.Message{ }, &i18n.Message{
ID: "StageLines", ID: "StageLines",
Other: `stage individual hunks/lines`, Other: `stage individual hunks/lines`,