more lenient getting of short shas

This commit is contained in:
Jesse Duffield 2020-03-26 09:18:52 +11:00
parent 569ec5919c
commit 37acc17cf3
4 changed files with 12 additions and 5 deletions

View file

@ -13,3 +13,10 @@ type Commit struct {
Author string
Date string
}
func (c *Commit) ShortSha() string {
if len(c.Sha) < 8 {
return c.Sha
}
return c.Sha[:8]
}