jesseduffield.lazygit/pkg/integration/tests/submodule
Stefan Haller 785c8a712c Explain when a submodule has nothing stageable
A submodule that only has dirty or untracked content (no new commit) can't
be staged from the parent repo, but it still shows up as having unstaged
changes. Pressing stage on it therefore briefly flashed as staged and then
reverted, without explaining why nothing was staged.

Detect this case (via `git submodule status`, where a '+' prefix marks a
stageable commit change) in the shared stage/unstage decision: if the only
thing that looks stageable is such a submodule, don't try to stage it.
Instead unstage if there's anything staged to unstage, so the toggle stays
symmetric; otherwise show an error explaining that there's nothing to stage.

Because the decision is shared, this covers both the stage (space) and
stage-all (a) keybindings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 09:12:09 +02:00
..
add.go Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
enter.go Convert custom command Key fields to Keybinding 2026-05-25 15:32:47 +02:00
enter_nested.go Remove conditional code related to git earlier than 2.22 2025-04-09 10:40:52 +02:00
remove.go Add integration test 2025-04-07 09:42:19 +02:00
remove_nested.go Make file sort order and case sensitivity configurable 2026-03-30 17:53:25 +02:00
reset.go Convert custom command Key fields to Keybinding 2026-05-25 15:32:47 +02:00
reset_folder.go Update disabled message 2025-04-07 09:42:19 +02:00
shared.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
stage.go Also verify stage-all can unstage a dirty submodule 2026-06-04 09:12:09 +02:00
stage_all_with_dirty_submodule.go Explain when a submodule has nothing stageable 2026-06-04 09:12:09 +02:00
stage_dirty_only.go Explain when a submodule has nothing stageable 2026-06-04 09:12:09 +02:00