Files
lazygit/pkg/integration/tests/commit/goto_bottom_in_branch_stack.go
Stefan HallerandClaude Opus 5.5 462a168d87 Make "go to bottom" stop at the beginning of each branch of a stack
In a stack of branches, pressing '>' in the commits panel went to the
beginning of the bottommost branch right away. Make it go to the
beginning of the branch that the selection is in first, and then to the
beginning of each branch below it. During a rebase, the update-ref todos
separate the branches among the todos, so stop above each of them too.

The branches of the stack are the ones that the commits list marks, and
that pushing and pulling a stack include.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:46:15 +01:00

83 lines
2.5 KiB
Go

package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var GotoBottomInBranchStack = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Go to the bottom of the commits list in steps, stopping at the beginning of each branch of a stack",
ExtraCmdArgs: []string{},
Skip: false,
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.
CreateNCommits(2).
NewBranch("branch1").
CreateNCommitsStartingAt(2, 3).
NewBranch("branch2").
CreateNCommitsStartingAt(2, 5)
shell.SetConfig("rebase.updateRefs", "true")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("CI ○ commit-06").IsSelected(),
Contains("CI ○ commit-05"),
Contains("CI ○ * commit-04"),
Contains("CI ○ commit-03"),
Contains("CI ○ commit-02"),
Contains("CI ○ commit-01"),
).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-05")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-03")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-01"))
t.Views().Branches().
Focus().
NavigateToLine(Contains("branch2")).
PressEnter()
t.Views().SubCommits().
IsFocused().
SelectedLine(Contains("commit-06")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-05")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-03")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-01"))
t.Views().Commits().
Focus().
NavigateToLine(Contains("commit-03")).
Press(keys.Universal.Edit).
NavigateToLine(Contains("commit-06")).
Lines(
Contains("─── Pending rebase todos"),
Contains("pick").Contains("CI commit-06").IsSelected(),
Contains("pick").Contains("CI commit-05"),
Contains("update-ref").Contains("branch1"),
Contains("pick").Contains("CI commit-04"),
Contains("─── Commits"),
Contains("CI ○ commit-03"),
Contains("CI ○ commit-02"),
Contains("CI ○ commit-01"),
).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-05")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-04")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-03")).
Press(keys.Universal.GotoBottom).
SelectedLine(Contains("commit-01"))
},
})