diff options
author | Jeremy Anderson <jeremy@code-adept.com> | 2012-07-27 22:18:04 -0400 |
---|---|---|
committer | Jeremy Anderson <jeremy@code-adept.com> | 2012-07-27 22:18:04 -0400 |
commit | e6edaa3b502090f461b58c439ea476da2d37f039 (patch) | |
tree | a9cd55849df039f524ff2b5cbce55c38e9768e04 /app/models/commit.rb | |
parent | 0301ba3315436a2dc466415ab0a3dd4fd7be3931 (diff) | |
parent | 3caf0aa89a964b8b3dcd21536e5bc274165ed2a2 (diff) | |
download | gitlab-ce-e6edaa3b502090f461b58c439ea476da2d37f039.tar.gz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 859bee29fa5..71c41350c95 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -114,6 +114,10 @@ class Commit @head = head end + def short_id(length = 10) + id.to_s[0..length] + end + def safe_message utf8 message end @@ -150,4 +154,8 @@ class Commit def prev_commit_id prev_commit.try :id end + + def parents_count + parents && parents.count || 0 + end end |