diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-30 22:05:34 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 08:09:42 +1000 |
commit | 71d4c552aff78fc4095a3fd03b1e250511fbb13f (patch) | |
tree | 4f6a5f17bc13eeeca2446f990f811e55f04b855d /pkg/commands/submodules.go | |
parent | d4ab607d0dd94f73eb1dcd4ba9842eb86b6aa0f4 (diff) |
allow updating submodule url
Diffstat (limited to 'pkg/commands/submodules.go')
-rw-r--r-- | pkg/commands/submodules.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/commands/submodules.go b/pkg/commands/submodules.go index 659c2d2d8..493c76eba 100644 --- a/pkg/commands/submodules.go +++ b/pkg/commands/submodules.go @@ -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) +} |