Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-06-28 12:04:18 +0300
committerSean McGivern <sean@mcgivern.me.uk>2018-06-28 12:04:18 +0300
commit5e7988eeccd017f2948831bdaab3bbdbc2e2b544 (patch)
treecee16fdeff3c18a8bbb588e85e66d01d0ca349b1 /lib/api
parent687278a6dd4296ecdd61028d4ad7ea3d2b2b7df3 (diff)
parent591edb439c2608f7448d7c3d5d2fc35e0ad5e8c1 (diff)
Merge branch 'straight-comparision-mode' into 'master'
Allow straight diff in Compare API See merge request gitlab-org/gitlab-ce!20120
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/repositories.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb
index bb3fa99af38..33a9646ac3b 100644
--- a/lib/api/repositories.rb
+++ b/lib/api/repositories.rb
@@ -100,9 +100,10 @@ module API
params do
requires :from, type: String, desc: 'The commit, branch name, or tag name to start comparison'
requires :to, type: String, desc: 'The commit, branch name, or tag name to stop comparison'
+ optional :straight, type: Boolean, desc: 'Comparison method, `true` for direct comparison between `from` and `to` (`from`..`to`), `false` to compare using merge base (`from`...`to`)', default: false
end
get ':id/repository/compare' do
- compare = Gitlab::Git::Compare.new(user_project.repository.raw_repository, params[:from], params[:to])
+ compare = Gitlab::Git::Compare.new(user_project.repository.raw_repository, params[:from], params[:to], straight: params[:straight])
present compare, with: Entities::Compare
end