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:
@ -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)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user