diff options
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index a1343b65c72..61551df9e27 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -26,6 +26,10 @@ class Commit def diff_line_count(diffs) diffs.reduce(0) { |sum, d| sum + d.diff.lines.count } end + + def truncate_sha(sha) + sha[0..10] + end end attr_accessor :raw @@ -111,7 +115,7 @@ class Commit # Mentionable override. def gfm_reference - "commit #{sha[0..5]}" + "commit #{short_id}" end def method_missing(m, *args, &block) |