mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-10-24 17:25:19 +08:00
* Fix #3321: commit tag shortener * Check short commit * remove debug * Edit unit tests * Show 10-char short SHA
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user