1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Allow cycling between multiple log commands

- Introduced a new optional user config command, allBranchesLogCmds
- When pressing 'a' in the Status view, cycle between non-empty, non-identical log commands
- There will always be at least one command to run, since allBranhesLogCmd has a default
- Update documentation & write an integration test
- Update translation string
This commit is contained in:
Martin Kock
2024-07-06 21:59:10 +10:00
committed by Jesse Duffield
parent 3d14893c65
commit be21328c69
8 changed files with 65 additions and 6 deletions

View File

@ -0,0 +1,33 @@
package status
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var LogCmd = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Cycle between two different log commands in the Status view",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Git.AllBranchesLogCmd = `echo "view1"`
config.UserConfig.Git.AllBranchesLogCmds = []string{`echo "view2"`}
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Status().
Focus().
Press(keys.Status.AllBranchesLogGraph)
t.Views().Main().Content(Contains("view1"))
t.Views().Status().
Focus().
Press(keys.Status.AllBranchesLogGraph)
t.Views().Main().Content(Contains("view2").DoesNotContain("view1"))
t.Views().Status().
Focus().
Press(keys.Status.AllBranchesLogGraph)
t.Views().Main().Content(Contains("view1").DoesNotContain("view2"))
},
})