From 7eafe3213f456bb4fcbaeea5562ab60c4ef6cf87 Mon Sep 17 00:00:00 2001 From: Thibault Meyer <0xbaadf00d@users.noreply.github.com> Date: Fri, 12 Aug 2016 00:34:00 +0200 Subject: Fix #3321: commit tag shortener (#3418) * Fix #3321: commit tag shortener * Check short commit * remove debug * Edit unit tests * Show 10-char short SHA --- modules/base/tool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/base') diff --git a/modules/base/tool.go b/modules/base/tool.go index 6088daf0..cf8fece0 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -45,7 +45,7 @@ func EncodeSha1(str string) string { } func ShortSha(sha1 string) string { - if len(sha1) == 40 { + if len(sha1) > 10 { return sha1[:10] } return sha1 -- cgit v1.2.3