1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Draw divergence from base branch right-aligned in branches view

Also, remove it from the status view. I'd say it isn't really needed there,
although I don't have a strong opinion about that.
This commit is contained in:
Stefan Haller
2025-07-24 18:32:33 +02:00
parent d7626d4ccf
commit abb7bed0c4
6 changed files with 53 additions and 44 deletions

View File

@ -32,7 +32,7 @@ var RebaseOntoBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Branches().
Focus().
Lines(
Contains("feature ↓1").IsSelected(),
MatchesRegexp(`feature\s+↓1`).IsSelected(),
Contains("master"),
).
Press(keys.Branches.RebaseBranch)

View File

@ -25,7 +25,7 @@ var ShowDivergenceFromBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Branches().
Focus().
Lines(
Contains("feature ↓1").IsSelected(),
MatchesRegexp(`feature\s+↓1`).IsSelected(),
Contains("master"),
).
Press(keys.Branches.SetUpstream)

View File

@ -1,27 +0,0 @@
package status
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var ShowDivergenceFromBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Show divergence from base branch in the status panel",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
},
SetupRepo: func(shell *Shell) {
shell.CreateNCommits(2)
shell.CloneIntoRemote("origin")
shell.NewBranch("feature")
shell.HardReset("HEAD^")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.GlobalPress(keys.Universal.NextBlock)
t.Views().Status().
Content(Equals("↓1 repo → feature"))
},
})

View File

@ -373,7 +373,6 @@ var tests = []*components.IntegrationTest{
status.ClickWorkingTreeStateToOpenRebaseOptionsMenu,
status.LogCmd,
status.LogCmdStatusPanelAllBranchesLog,
status.ShowDivergenceFromBaseBranch,
submodule.Add,
submodule.Enter,
submodule.EnterNested,