Add a test showing that a current bisect commit far down isn't selected

The commits view loads the first 300 commits only. If the range to
bisect is longer than about 600 commits, the commit that git wants the
user to test is further down than that. It isn't loaded, so we can't
select it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Stefan HallerandClaude Opus 5.5 committed 2026-10-31 11:27:58 +01:00
1 parent ee07abe508
commit 990913dd63
2 files changed
+32

No files matched your search

@@ -0,0 +1,31 @@
package bisect
import (
"fmt"
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var SelectCurrentCommitInLongRange = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Select the current bisect commit when it is further down than the commits that we load at first",
ExtraCmdArgs: []string{},
Skip: false,
SetupRepo: func(shell *Shell) {
for i := range 700 {
shell.EmptyCommit(fmt.Sprintf("commit %03d", i+1))
}
shell.StartBisect("HEAD", "HEAD~699")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.Log.ShowGraph = "never"
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
/* EXPECTED:
SelectedLine(Contains("<-- current"))
ACTUAL: */
SelectedLine(Contains("commit 700"))
},
})
+1
View File
@@ -40,6 +40,7 @@ var tests = []*components.IntegrationTest{
bisect.ChooseTerms,
bisect.FromOtherBranch,
bisect.SelectCurrentCommit,
bisect.SelectCurrentCommitInLongRange,
bisect.Skip,
branch.CheckoutAutostash,
branch.CheckoutByName,