1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

manually update submodule url

This commit is contained in:
Jesse Duffield
2020-10-01 07:19:53 +10:00
parent 5d128adee1
commit 988176e073
2 changed files with 9 additions and 3 deletions

View File

@ -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)
}