mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
Git accepts "." as a submodule name, and so does GetConfigs. Removing such a submodule in lazygit deletes .git/modules, together with the git dirs of all other submodules. Any unpushed commits in those submodules are lost. Check the path of the git dir before running any git command, and refuse to remove the submodule if the path isn't below .git/modules. This also protects against names with ".." components, in case one ever gets past GetConfigs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>