mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-13 11:50:28 +02:00
manually update submodule url
This commit is contained in:
parent
5d128adee1
commit
988176e073
pkg
@ -103,6 +103,12 @@ func (c *GitCommand) SubmoduleAdd(name string, path string, url string) error {
|
||||
)
|
||||
}
|
||||
|
||||
func (c *GitCommand) SubmoduleUpdateUrl(path string, newUrl string) error {
|
||||
return c.OSCommand.RunCommand("git submodule set-url -- %s %s", path, newUrl)
|
||||
func (c *GitCommand) SubmoduleUpdateUrl(name string, path string, newUrl string) error {
|
||||
// the set-url command is only for later git versions so we're doing it manually here
|
||||
if err := c.OSCommand.RunCommand("git config --file .gitmodules submodule.%s.url %s", name, newUrl); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.OSCommand.RunCommand("git submodule sync -- %s", path)
|
||||
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ func (gui *Gui) handleEditSubmoduleUrl() error {
|
||||
|
||||
return gui.prompt(gui.Tr.SLocalizef("updateSubmoduleUrl", submodule.Name), submodule.Url, func(newUrl string) error {
|
||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("updatingSubmoduleUrlStatus"), func() error {
|
||||
err := gui.GitCommand.SubmoduleUpdateUrl(submodule.Name, newUrl)
|
||||
err := gui.GitCommand.SubmoduleUpdateUrl(submodule.Name, submodule.Path, newUrl)
|
||||
gui.handleCredentialsPopup(err)
|
||||
|
||||
return gui.refreshSidePanels(refreshOptions{scope: []int{SUBMODULES}})
|
||||
|
Loading…
x
Reference in New Issue
Block a user