mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
Once git has nothing left to test, the commit that the user marked last stays the current commit. The commits view labels it "<-- current", although git doesn't want the user to test it any more. Show its mark instead, like for the other marked commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.5 KiB
Go
47 lines
1.5 KiB
Go
package bisect
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var SelectFirstBadCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Select the first bad commit when marking the last commit to test finishes the bisect",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.
|
|
CreateNCommits(10).
|
|
StartBisect("HEAD~2", "HEAD~5")
|
|
},
|
|
SetupConfig: func(cfg *config.AppConfig) {
|
|
cfg.GetUserConfig().Git.Log.ShowGraph = "never"
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Commits().
|
|
IsFocused().
|
|
TopLines(
|
|
Contains("CI commit-10"),
|
|
Contains("CI commit-09"),
|
|
Contains("CI commit-08").Contains("<-- bad"),
|
|
Contains("CI commit-07").Contains("<-- current").IsSelected(),
|
|
Contains("CI commit-06"),
|
|
Contains("CI commit-05").Contains("<-- good"),
|
|
).
|
|
Press(keys.Commits.ViewBisectOptions).
|
|
Tap(func() {
|
|
t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as good`)).Confirm()
|
|
|
|
t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit-08.*Do you want to reset")).Cancel()
|
|
}).
|
|
TopLines(
|
|
Contains("CI commit-10"),
|
|
Contains("CI commit-09"),
|
|
Contains("CI commit-08").Contains("<-- bad").IsSelected(),
|
|
Contains("CI commit-07").Contains("<-- good"),
|
|
Contains("CI commit-06"),
|
|
Contains("CI commit-05").Contains("<-- good"),
|
|
)
|
|
},
|
|
})
|