mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-29 22:48:24 +02:00
allow updating submodule
This commit is contained in:
@@ -77,7 +77,7 @@ func (gui *Gui) enterSubmodule(submodule *models.SubmoduleConfig) error {
|
||||
return gui.dispatchSwitchToRepo(submodule.Path)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleRemoveSubmodule(submodule *models.SubmoduleConfig) error {
|
||||
func (gui *Gui) removeSubmodule(submodule *models.SubmoduleConfig) error {
|
||||
return gui.ask(askOpts{
|
||||
title: gui.Tr.SLocalize("RemoveSubmodule"),
|
||||
prompt: gui.Tr.SLocalizef("RemoveSubmodulePrompt", submodule.Name),
|
||||
@@ -174,3 +174,31 @@ func (gui *Gui) forSubmodule(callback func(*models.SubmoduleConfig) error) func(
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleResetRemoveSubmodule(submodule *models.SubmoduleConfig) error {
|
||||
menuItems := []*menuItem{
|
||||
{
|
||||
displayString: gui.Tr.SLocalize("submoduleStashAndReset"),
|
||||
onPress: func() error {
|
||||
return gui.resetSubmodule(submodule)
|
||||
},
|
||||
},
|
||||
{
|
||||
displayString: gui.Tr.SLocalize("removeSubmodule"),
|
||||
onPress: func() error {
|
||||
return gui.removeSubmodule(submodule)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return gui.createMenu(submodule.Name, menuItems, createMenuOptions{showCancel: true})
|
||||
}
|
||||
|
||||
func (gui *Gui) handleUpdateSubmodule(submodule *models.SubmoduleConfig) error {
|
||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("updatingSubmoduleStatus"), func() error {
|
||||
err := gui.GitCommand.SubmoduleUpdate(submodule.Path)
|
||||
gui.handleCredentialsPopup(err)
|
||||
|
||||
return gui.refreshSidePanels(refreshOptions{scope: []int{SUBMODULES}})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user