summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-21 11:36:41 +0200
committerDouwe Maan <douwe@gitlab.com>2015-10-21 11:36:41 +0200
commitde0acf3cf7f27e7a4f32dc8cad6293f823eda300 (patch)
tree4f5810004fd2f23d5491116ca4f919efea88ee88 /app/models/commit.rb
parent9c2214f202e98d0427d86a57888574327a6607dd (diff)
parentd25b50fda63e830cb2c87281bba064b71185e712 (diff)
downloadgitlab-ce-de0acf3cf7f27e7a4f32dc8cad6293f823eda300.tar.gz
Merge branch 'master' into reference-pipeline-and-caching
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 23b5e38336c..492f6be1ce3 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -164,6 +164,14 @@ class Commit
@committer ||= User.find_by_any_email(committer_email)
end
+ def parents
+ @parents ||= parent_ids.map { |id| project.commit(id) }
+ end
+
+ def parent
+ @parent ||= project.commit(self.parent_id) if self.parent_id
+ end
+
def notes
project.notes.for_commit_id(self.id)
end
@@ -181,10 +189,6 @@ class Commit
@raw.short_id(7)
end
- def parents
- @parents ||= Commit.decorate(super, project)
- end
-
def ci_commit
project.ci_commit(sha)
end