1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-17 22:32:58 +02:00

Fix deleting submodule where name and path are different

This commit is contained in:
Stefan Haller 2024-02-10 19:47:36 +01:00
parent ddcd916301
commit ea87912a74
2 changed files with 1 additions and 4 deletions

View File

@ -141,7 +141,7 @@ func (self *SubmoduleCommands) Delete(submodule *models.SubmoduleConfig) error {
// We may in fact want to use the repo's git dir path but git docs say not to // We may in fact want to use the repo's git dir path but git docs say not to
// mix submodules and worktrees anyway. // mix submodules and worktrees anyway.
return os.RemoveAll(filepath.Join(self.repoPaths.WorktreeGitDirPath(), "modules", submodule.Path)) return os.RemoveAll(filepath.Join(self.repoPaths.WorktreeGitDirPath(), "modules", submodule.Name))
} }
func (self *SubmoduleCommands) Add(name string, path string, url string) error { func (self *SubmoduleCommands) Add(name string, path string, url string) error {

View File

@ -45,9 +45,6 @@ var Remove = NewIntegrationTest(NewIntegrationTestArgs{
Contains("- url = ../other_repo"), Contains("- url = ../other_repo"),
) )
/* EXPECTED:
t.FileSystem().PathNotPresent(gitDirSubmodulePath) t.FileSystem().PathNotPresent(gitDirSubmodulePath)
ACTUAL: */
t.FileSystem().PathPresent(gitDirSubmodulePath)
}, },
}) })