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 2016-08-12 00:34:00 +02:00 committed by 无闻
parent 2cb04db526
commit 7eafe3213f
3 changed files with 5 additions and 5 deletions

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