Open RetoranPetra opened 4 weeks ago
Happy to take this on and give it a go this weekend. Like @RetoranPetra said, it doesn't seem too difficult so not expecting any surprises.
Happy to take this on and give it a go this weekend. Like @RetoranPetra said, it doesn't seem too difficult so not expecting any surprises.
Sounds great, I had a quick look today and didn't manage to make a dent in it and I'll be busy this weekend.
No trouble recreating the issue. Still working on the actual fix. Will most likely share what I have at this stage for some guidance if no more progress is made soon.
Describe the bug As described above, when attempting to unstage a submodule's changes with spacebar after staging said changes, instead of unstaging the currently staged changes within the submodule it quickly moves the changes from "staged" to "unstaged" and back again. This behaviour only occurs when the submodule has uncommitted changes within itself.
To Reproduce
Expected behavior When there are unstaged changes within the submodule that cannot be staged due to those changes themselves not being staged within the submodule, pressing spacebar should unstage the current change to the submodule's commit hash. Spacebar should call
git reset $SUBMODULE_NAME
instead ofgit add $SUBMODULE_NAME
Screenshots Submodule has modified content that has not yet been committed to the submodule, as well as changes that have been committed to the submodule.
When attempting to unstage this with a "spacebar" keypress, lazygit will attempt to stage the uncommitted changes in the submodule despite it not having a commit.
After this doesn't work, lazygit will reset to the first screenshot showing that the submodule contains modified content.
Version info: commit=, build date=, build source=unknown, version=unversioned, os=windows, arch=amd64, git version=2.45.1.windows.1 git version 2.45.1.windows.1
Additional context Version info as of writing seems to be broken on my machine, likely as I've installed lazygit through go install on windows through MSYS2 specific go. The build I'm using is v0.42.1, but I've had this issue ever since I've been using lazygit.
I'll likely put in a pull request for this issue myself at some point as it doesn't seem too hard to solve.