diff options
author | Thibault Meyer <0xbaadf00d@users.noreply.github.com> | 2016-08-12 00:34:00 +0200 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-08-11 15:34:00 -0700 |
commit | 7eafe3213f456bb4fcbaeea5562ab60c4ef6cf87 (patch) | |
tree | 735dcb1d84219002924be4b49caed3056602d854 /modules/base | |
parent | 2cb04db52661b346bed26daeb94402f460195797 (diff) | |
download | gitea-7eafe3213f456bb4fcbaeea5562ab60c4ef6cf87.tar.gz gitea-7eafe3213f456bb4fcbaeea5562ab60c4ef6cf87.zip |
Fix #3321: commit tag shortener (#3418)
* Fix #3321: commit tag shortener
* Check short commit
* remove debug
* Edit unit tests
* Show 10-char short SHA
Diffstat (limited to 'modules/base')
-rw-r--r-- | modules/base/tool.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go index 6088daf033..cf8fece027 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 |