1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Merge branch 'master' into feature/informative-commit-colors

This commit is contained in:
Jesse Duffield
2018-09-20 09:41:29 +10:00
51 changed files with 1126 additions and 359 deletions

30
pkg/commands/commit.go Normal file
View File

@ -0,0 +1,30 @@
package commands
import (
"github.com/fatih/color"
)
// Commit : A git commit
type Commit struct {
Sha string
Name string
Pushed bool
Merged bool
DisplayString string
}
func (c *Commit) GetDisplayStrings() []string {
red := color.New(color.FgRed)
yellow := color.New(color.FgGreen)
green := color.New(color.FgYellow)
white := color.New(color.FgWhite)
shaColor := yellow
if c.Pushed {
shaColor = red
} else if !c.Merged {
shaColor = green
}
return []string{shaColor.Sprint(c.Sha), white.Sprint(c.Name)}
}