diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-11-07 16:35:36 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-06-01 19:21:24 +1000 |
commit | a4db44bc3dab55c203c5f4d40c131c9c4adaf793 (patch) | |
tree | 6de159b0fcd225e8c96eebea5e852dc4bbefc6cd /pkg/utils | |
parent | 4b3f8055d0746c44787c6ba026630f29e7f049b5 (diff) |
show commits against branches
Diffstat (limited to 'pkg/utils')
-rw-r--r-- | pkg/utils/formatting.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/utils/formatting.go b/pkg/utils/formatting.go index 2a900d207..5d04a16a8 100644 --- a/pkg/utils/formatting.go +++ b/pkg/utils/formatting.go @@ -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] } |