Files
Stefan HallerandClaude Opus 5.5 93556c1588 Ignore submodules with a suspicious path in .gitmodules
If .gitmodules contains a submodule path like "../other_repo", nuking
the working tree in lazygit stashes all changes and untracked files of
that other repository. The same happens if the path is a symlink that
points to it. The changes can be recovered with "git stash pop" in that
repository, but the user has no reason to look there.

This happens because lazygit runs some commands in the submodule's
directory, and takes that directory from .gitmodules as it is. Git
itself only uses a path from .gitmodules if its index has a submodule
at that path, and such a path can't lead out of the repository.

Ignore a submodule unless its path is a directory below the directory
that contains the .gitmodules file, without any symlinks in between.
This also keeps GetConfigs from reading the same .gitmodules file again
and again for a path of ".".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:59:32 +01:00
..
2025-11-16 17:26:00 +01:00
2025-01-03 10:50:36 +11:00