From 990913dd6393af0c586e23fd3ecabc97ed41795e Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 30 Oct 2026 21:09:44 +0100 Subject: [PATCH] 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 --- .../select_current_commit_in_long_range.go | 31 +++++++++++++++++++ pkg/integration/tests/test_list.go | 1 + 2 files changed, 32 insertions(+) create mode 100644 pkg/integration/tests/bisect/select_current_commit_in_long_range.go diff --git a/pkg/integration/tests/bisect/select_current_commit_in_long_range.go b/pkg/integration/tests/bisect/select_current_commit_in_long_range.go new file mode 100644 index 000000000..e3ad8aeba --- /dev/null +++ b/pkg/integration/tests/bisect/select_current_commit_in_long_range.go @@ -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")) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 15aa27ea5..decdd2b73 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -40,6 +40,7 @@ var tests = []*components.IntegrationTest{ bisect.ChooseTerms, bisect.FromOtherBranch, bisect.SelectCurrentCommit, + bisect.SelectCurrentCommitInLongRange, bisect.Skip, branch.CheckoutAutostash, branch.CheckoutByName,