summaryrefslogtreecommitdiff
path: root/app/models/compare.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-09-29 14:04:50 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-12 16:32:57 +0300
commitac4db38094f4a68a81b0a7570c5835f663c01cfd (patch)
tree32d138231d031d563810391f9707027657cb94ad /app/models/compare.rb
parentc143003bfbd5cda725451c38ff1eca8ba469409b (diff)
downloadgitlab-ce-ac4db38094f4a68a81b0a7570c5835f663c01cfd.tar.gz
Use straight diff approach when compare merge request versions
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/compare.rb')
-rw-r--r--app/models/compare.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/compare.rb b/app/models/compare.rb
index 4856510f526..4b568a1d11c 100644
--- a/app/models/compare.rb
+++ b/app/models/compare.rb
@@ -11,9 +11,10 @@ class Compare
end
end
- def initialize(compare, project)
+ def initialize(compare, project, straight = false)
@compare = compare
@project = project
+ @straight = straight
end
def commits
@@ -36,6 +37,8 @@ class Compare
alias_method :commit, :head_commit
def base_commit
+ return start_commit if @straight
+
return @base_commit if defined?(@base_commit)
@base_commit = if start_commit && head_commit