diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-07-26 18:24:25 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-08-02 13:31:19 +0300 |
commit | b8fef7eb5948344f4d442a52637cad168f4c5bf1 (patch) | |
tree | e426439fd506d6126d96ec45e2b1ba74e8f971c7 /app/models/merge_request_diff.rb | |
parent | 94ca25c9b8c62f9995fbd571c33954754950e1da (diff) | |
download | gitlab-ce-b8fef7eb5948344f4d442a52637cad168f4c5bf1.tar.gz |
Add ability to render different merge request versions
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/merge_request_diff.rb')
-rw-r--r-- | app/models/merge_request_diff.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 3f520c8f3ff..a92f597225a 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -96,6 +96,16 @@ class MergeRequestDiff < ActiveRecord::Base end end + def diff_refs + return unless start_commit || base_commit + + Gitlab::Diff::DiffRefs.new( + base_sha: base_commit_sha, + start_sha: start_commit_sha, + head_sha: head_commit_sha + ) + end + private # Collect array of Git::Commit objects |