summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-01 07:19:53 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-10-02 08:09:42 +1000
commit988176e07374f67885fa4e3dd498a5e8fc1cc06c (patch)
tree9ffa3dd8dfde85e46e80c5e904d005d3e02e0349 /pkg/commands
parent5d128adee14991c7426c59fef04d8aad711f07d8 (diff)
manually update submodule url
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/submodules.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/commands/submodules.go b/pkg/commands/submodules.go
index 493c76eba..41ea3bbbf 100644
--- a/pkg/commands/submodules.go
+++ b/pkg/commands/submodules.go
@@ -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)
+
}