summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorJeremy Anderson <jeremy@code-adept.com>2012-07-27 22:18:04 -0400
committerJeremy Anderson <jeremy@code-adept.com>2012-07-27 22:18:04 -0400
commite6edaa3b502090f461b58c439ea476da2d37f039 (patch)
treea9cd55849df039f524ff2b5cbce55c38e9768e04 /app/models/commit.rb
parent0301ba3315436a2dc466415ab0a3dd4fd7be3931 (diff)
parent3caf0aa89a964b8b3dcd21536e5bc274165ed2a2 (diff)
downloadgitlab-ce-e6edaa3b502090f461b58c439ea476da2d37f039.tar.gz
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb8
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