1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-23 22:24:51 +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

@@ -113,11 +113,11 @@ func Test_getBranchDisplayStrings(t *testing.T) {
},
itemOperation: types.ItemOperationNone,
fullDescription: false,
viewWidth: 100,
viewWidth: 20,
useIcons: false,
checkedOutByWorktree: false,
showDivergenceCfg: "onlyArrow",
expected: []string{"1m", "branch_name ↓"},
expected: []string{"1m", "branch_name ↓"},
},
{
branch: &models.Branch{
@@ -130,11 +130,11 @@ func Test_getBranchDisplayStrings(t *testing.T) {
},
itemOperation: types.ItemOperationNone,
fullDescription: false,
viewWidth: 100,
viewWidth: 22,
useIcons: false,
checkedOutByWorktree: false,
showDivergenceCfg: "arrowAndNumber",
expected: []string{"1m", "branch_name ✓ ↓2"},
expected: []string{"1m", "branch_name ✓ ↓2"},
},
{
branch: &models.Branch{
@@ -147,11 +147,11 @@ func Test_getBranchDisplayStrings(t *testing.T) {
},
itemOperation: types.ItemOperationNone,
fullDescription: false,
viewWidth: 100,
viewWidth: 26,
useIcons: false,
checkedOutByWorktree: false,
showDivergenceCfg: "arrowAndNumber",
expected: []string{"1m", "branch_name ↓5↑3 ↓2"},
expected: []string{"1m", "branch_name ↓5↑3 ↓2"},
},
{
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
@@ -240,6 +240,23 @@ func Test_getBranchDisplayStrings(t *testing.T) {
showDivergenceCfg: "none",
expected: []string{"1m", "branch_… ✓"},
},
{
branch: &models.Branch{
Name: "branch_name",
Recency: "1m",
UpstreamRemote: "origin",
AheadForPull: "3",
BehindForPull: "5",
BehindBaseBranch: makeAtomic(4),
},
itemOperation: types.ItemOperationNone,
fullDescription: false,
viewWidth: 21,
useIcons: false,
checkedOutByWorktree: false,
showDivergenceCfg: "arrowAndNumber",
expected: []string{"1m", "branch_n… ↓5↑3 ↓4"},
},
{
branch: &models.Branch{
Name: "branch_name",