jesseduffield.lazygit/pkg/integration/tests/submodule
Stefan Haller 3f0a7512f8 Fix unstaging a submodule with dirty content
The stage/unstage toggle decides what to do based on whether a node has
unstaged changes: if it does, it stages; otherwise it unstages. For a
submodule this breaks down, because dirty or untracked content inside the
submodule always reports as an unstaged change in the parent repo but can
never be staged from there. Once such a submodule's commit pointer is
staged it sits at "MM", and every subsequent press keeps trying to stage
the unstageable dirty content, so it can never be unstaged.

Treat a submodule's unstaged change as stageable only when its commit
isn't already staged, so that a staged submodule unstages on the next
press regardless of leftover dirty content. Because the decision is now
shared by press and stage-all, this fixes both at once.

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 Fix unstaging a submodule with dirty content 2026-06-04 09:12:09 +02:00