summaryrefslogtreecommitdiffstats
path: root/pkg/commands/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/commit.go')
-rw-r--r--pkg/commands/commit.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/pkg/commands/commit.go b/pkg/commands/commit.go
new file mode 100644
index 000000000..37c3e9525
--- /dev/null
+++ b/pkg/commands/commit.go
@@ -0,0 +1,26 @@
+package commands
+
+import (
+ "github.com/fatih/color"
+)
+
+// Commit : A git commit
+type Commit struct {
+ Sha string
+ Name string
+ Pushed bool
+ DisplayString string
+}
+
+func (c *Commit) GetDisplayStrings() []string {
+ red := color.New(color.FgRed)
+ yellow := color.New(color.FgYellow)
+ white := color.New(color.FgWhite)
+
+ shaColor := yellow
+ if c.Pushed {
+ shaColor = red
+ }
+
+ return []string{shaColor.Sprint(c.Sha), white.Sprint(c.Name)}
+}