diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-07-25 11:33:39 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-07-31 08:34:01 +0200 |
commit | f5c9764dd265d700ef5b829cbcbe045cc0d62965 (patch) | |
tree | 2b753c6c88359388b4fb65f06c306142c073aaac /pkg/integration | |
parent | 6dc25d796b0315764c4c50a590dde91c802ea5dc (diff) |
Don't show branch heads in reflog subcommits
It's tricky to get this right for reflog commits wrt what's the current branch
for each one; so just disable it entirely here, it's probably not something
anybody needs here.
Diffstat (limited to 'pkg/integration')
-rw-r--r-- | pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go | 71 | ||||
-rw-r--r-- | pkg/integration/tests/test_list.go | 1 |
2 files changed, 72 insertions, 0 deletions
diff --git a/pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go b/pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go new file mode 100644 index 000000000..8e888c95a --- /dev/null +++ b/pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go @@ -0,0 +1,71 @@ +package reflog + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var DoNotShowBranchMarkersInReflogSubcommits = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Verify that no branch heads are shown in the subcommits view of a reflog entry", + ExtraCmdArgs: []string{}, + Skip: false, + SetupConfig: func(config *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.NewBranch("branch1") + shell.EmptyCommit("one") + shell.EmptyCommit("two") + shell.NewBranch("branch2") + shell.EmptyCommit("three") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + // Check that the local commits view does show a branch marker for branch1 + t.Views().Commits(). + Lines( + Contains("CI three"), + Contains("CI * two"), + Contains("CI one"), + ) + + t.Views().Branches(). + Focus(). + // Check out branch1 + NavigateToLine(Contains("branch1")). + PressPrimaryAction(). + // Look at the subcommits of branch2 + NavigateToLine(Contains("branch2")). + PressEnter(). + // Check that we see a marker for branch1 here (but not for + // branch2), even though branch1 is checked out + Tap(func() { + t.Views().SubCommits(). + IsFocused(). + Lines( + Contains("CI three"), + Contains("CI * two"), + Contains("CI one"), + ). + PressEscape() + }). + // Check out branch2 again + NavigateToLine(Contains("branch2")). + PressPrimaryAction() + + t.Views().ReflogCommits(). + Focus(). + TopLines( + Contains("checkout: moving from branch1 to branch2").IsSelected(), + ). + PressEnter(). + // Check that the subcommits view for a reflog entry doesn't show + // any branch markers + Tap(func() { + t.Views().SubCommits(). + IsFocused(). + Lines( + Contains("CI three"), + Contains("CI two"), + Contains("CI one"), + ) + }) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index fa58676f2..9dcb57dee 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -163,6 +163,7 @@ var tests = []*components.IntegrationTest{ patch_building.StartNewPatch, reflog.Checkout, reflog.CherryPick, + reflog.DoNotShowBranchMarkersInReflogSubcommits, reflog.Patch, reflog.Reset, staging.DiffContextChange, |