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

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]
}