mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-25 00:46:54 +02:00
allow fetching remotes with 'f'
This commit is contained in:
@ -1109,3 +1109,7 @@ func (c *GitCommand) DeleteTag(tagName string) error {
|
|||||||
func (c *GitCommand) PushTag(remoteName string, tagName string) error {
|
func (c *GitCommand) PushTag(remoteName string, tagName string) error {
|
||||||
return c.OSCommand.RunCommand("git push %s %s", remoteName, tagName)
|
return c.OSCommand.RunCommand("git push %s %s", remoteName, tagName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *GitCommand) FetchRemote(remoteName string) error {
|
||||||
|
return c.OSCommand.RunCommand("git fetch %s", remoteName)
|
||||||
|
}
|
||||||
|
@ -454,6 +454,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
Handler: gui.handleRemoteBranchesEscape,
|
Handler: gui.handleRemoteBranchesEscape,
|
||||||
Description: gui.Tr.SLocalize("ReturnToRemotesList"),
|
Description: gui.Tr.SLocalize("ReturnToRemotesList"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ViewName: "branches",
|
||||||
|
Contexts: []string{"remotes"},
|
||||||
|
Key: 'f',
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: gui.handleFetchRemote,
|
||||||
|
Description: gui.Tr.SLocalize("fetchRemote"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Key: 's',
|
Key: 's',
|
||||||
|
@ -176,3 +176,18 @@ func (gui *Gui) handleEditRemote(g *gocui.Gui, v *gocui.View) error {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) handleFetchRemote(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
remote := gui.getSelectedRemote()
|
||||||
|
if remote == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return gui.WithWaitingStatus(gui.Tr.SLocalize("FetchingRemoteStatus"), func() error {
|
||||||
|
if err := gui.GitCommand.FetchRemote(remote.Name); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return gui.refreshRemotes()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -912,6 +912,12 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
|||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "CreateTagTitle",
|
ID: "CreateTagTitle",
|
||||||
Other: "Tag name:",
|
Other: "Tag name:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "fetchRemote",
|
||||||
|
Other: "fetch remote",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "FetchingRemoteStatus",
|
||||||
|
Other: "fetching remote",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user