1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

show commits against branches

This commit is contained in:
Jesse Duffield
2022-11-07 16:35:36 +11:00
parent 4b3f8055d0
commit a4db44bc3d
10 changed files with 170 additions and 72 deletions

View File

@ -149,9 +149,11 @@ func SafeTruncate(str string, limit int) string {
}
}
const COMMIT_HASH_SHORT_SIZE = 8
func ShortSha(sha string) string {
if len(sha) < 8 {
if len(sha) < COMMIT_HASH_SHORT_SIZE {
return sha
}
return sha[:8]
return sha[:COMMIT_HASH_SHORT_SIZE]
}