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

allow updating submodule url

This commit is contained in:
Jesse Duffield
2020-09-30 22:05:34 +10:00
parent d4ab607d0d
commit 71d4c552af
4 changed files with 38 additions and 10 deletions

View File

@ -94,7 +94,7 @@ func (c *GitCommand) SubmoduleDelete(submodule *models.SubmoduleConfig) error {
return os.RemoveAll(filepath.Join(c.DotGitDir, "modules", submodule.Path))
}
func (c *GitCommand) AddSubmodule(name string, path string, url string) error {
func (c *GitCommand) SubmoduleAdd(name string, path string, url string) error {
return c.OSCommand.RunCommand(
"git submodule add --force --name %s -- %s %s ",
c.OSCommand.Quote(name),
@ -102,3 +102,7 @@ func (c *GitCommand) AddSubmodule(name string, path string, url string) error {
c.OSCommand.Quote(path),
)
}
func (c *GitCommand) SubmoduleUpdateUrl(path string, newUrl string) error {
return c.OSCommand.RunCommand("git submodule set-url -- %s %s", path, newUrl)
}