diff options
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index c30a630429a..cbe0a39bc70 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -27,8 +27,9 @@ class Commit diffs.reduce(0) { |sum, d| sum + d.diff.lines.count } end + # Truncate sha to 8 characters def truncate_sha(sha) - sha[0..10] + sha[0..7] end end @@ -128,6 +129,11 @@ class Commit super end + # Truncate sha to 8 characters + def short_id + @raw.short_id(7) + end + def parents @parents ||= Commit.decorate(super) end |