1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

allow updating submodule

This commit is contained in:
Jesse Duffield
2020-10-01 09:04:09 +10:00
parent da3e00823f
commit 86dd9d87dd
6 changed files with 54 additions and 11 deletions

View File

@ -101,7 +101,8 @@ func (c *GitCommand) SubmoduleDelete(submodule *models.SubmoduleConfig) error {
}
if err := c.OSCommand.RunCommand("git rm --force -r %s", submodule.Path); err != nil {
return err
// if the directory isn't there then that's fine
c.Log.Error(err)
}
return os.RemoveAll(filepath.Join(c.DotGitDir, "modules", submodule.Path))
@ -128,3 +129,7 @@ func (c *GitCommand) SubmoduleUpdateUrl(name string, path string, newUrl string)
func (c *GitCommand) SubmoduleInit(path string) error {
return c.OSCommand.RunCommand("git submodule init %s", path)
}
func (c *GitCommand) SubmoduleUpdate(path string) error {
return c.OSCommand.RunCommand("git submodule update --init %s", path)
}