1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Add "Show divergence from upstream" entry to Upstream menu in branches panel

This commit is contained in:
Stefan Haller
2023-08-05 12:06:37 +02:00
parent e8fac6ca73
commit 572d1b5920
8 changed files with 116 additions and 17 deletions

View File

@ -359,7 +359,9 @@ func displayCommit(
}
cols := make([]string, 0, 7)
if icons.IsIconEnabled() {
if commit.Divergence != models.DivergenceNone {
cols = append(cols, shaColor.Sprint(lo.Ternary(commit.Divergence == models.DivergenceLeft, "↑", "↓")))
} else if icons.IsIconEnabled() {
cols = append(cols, shaColor.Sprint(icons.IconForCommit(commit)))
}
cols = append(cols, shaColor.Sprint(commit.ShortSha()))
@ -430,6 +432,8 @@ func getShaColor(
shaColor = theme.DiffTerminalColor
} else if cherryPickedCommitShaSet.Includes(commit.Sha) {
shaColor = theme.CherryPickedCommitTextStyle
} else if commit.Divergence == models.DivergenceRight && commit.Status != models.StatusMerged {
shaColor = style.FgBlue
}
return shaColor