Fix #3321: commit tag shortener (#3418)

* Fix #3321: commit tag shortener

* Check short commit

* remove debug

* Edit unit tests

* Show 10-char short SHA
This commit is contained in:
Thibault Meyer authored and 无闻 committed 2016-08-11 15:34:00 -07:00
1 parent 2cb04db526
commit 7eafe3213f
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -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