From c46c8744429c9dd29e95b62c8002f0875e635b62 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 2 Jun 2026 12:09:41 +0200 Subject: [PATCH] Also verify stage-all can unstage a dirty submodule Before the staging decision was unified, the stage (space) and stage-all (a) keybindings each made their own decision, so a fix to one wouldn't reach the other. Extend the test to drive the submodule through stage-all as well, guarding against that asymmetry coming back. Co-Authored-By: Claude Opus 4.8 (1M context) --- pkg/integration/tests/submodule/stage.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/integration/tests/submodule/stage.go b/pkg/integration/tests/submodule/stage.go index 324d7690f..b8ef5e35f 100644 --- a/pkg/integration/tests/submodule/stage.go +++ b/pkg/integration/tests/submodule/stage.go @@ -6,7 +6,7 @@ import ( ) var Stage = NewIntegrationTest(NewIntegrationTestArgs{ - Description: "Stage and unstage a submodule that has both a new commit and dirty content. The new commit can be staged, but the dirty content can't, so unstaging must still work.", + Description: "Stage and unstage a submodule that has both a new commit and dirty content. The new commit can be staged, but the dirty content can't, so unstaging must still work; this must hold for both the stage (space) and stage-all (a) keybindings.", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { @@ -39,6 +39,18 @@ var Stage = NewIntegrationTest(NewIntegrationTestArgs{ // Pressing again must unstage the submodule, taking us back to // " M" rather than trying (and failing) to stage the dirty content. PressPrimaryAction(). + Lines( + Equals(" M my_submodule_path (submodule)").IsSelected(), + ). + // The same has to hold for the stage-all keybinding, which shares + // the same decision logic: it stages the new commit... + Press(keys.Files.ToggleStagedAll). + Lines( + Equals("MM my_submodule_path (submodule)").IsSelected(), + ). + // ...and then unstages it again rather than getting stuck on the + // dirty content. + Press(keys.Files.ToggleStagedAll). Lines( Equals(" M my_submodule_path (submodule)").IsSelected(), )