summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-06-20 18:51:48 +0200
committerDouwe Maan <douwe@selenight.nl>2016-07-06 18:50:58 -0400
commita9fa45f09e6b6188691f37d75883b22edce7bba1 (patch)
tree93072651554f59e90c0c2a72761c2bb7f7edc719 /app/models/commit.rb
parent6ce25e7b4caa9e94de74378729178c7060d640b2 (diff)
downloadgitlab-ce-a9fa45f09e6b6188691f37d75883b22edce7bba1.tar.gz
Represent DiffRefs as proper class instead of tuple array
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 174ccbaea6c..2ef3973c160 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -214,6 +214,13 @@ class Commit
@raw.short_id(7)
end
+ def diff_refs
+ Gitlab::Diff::DiffRefs.new(
+ base_sha: self.parent_id || self.sha,
+ head_sha: self.sha
+ )
+ end
+
def pipelines
@pipeline ||= project.pipelines.where(sha: sha)
end