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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 21:08:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 21:08:47 +0300
commit3832718d895bf8268f3e3aac85948e2792769345 (patch)
tree4a322399af568b6203e732ae2e2f3efc39b23a67 /lib/api/repositories.rb
parent180cd023a11c0eb413ad0de124d9758ea25672bd (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/repositories.rb')
-rw-r--r--lib/api/repositories.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb
index 4106a2cdf38..00473db1ff1 100644
--- a/lib/api/repositories.rb
+++ b/lib/api/repositories.rb
@@ -103,8 +103,13 @@ module API
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], straight: params[:straight])
- present compare, with: Entities::Compare
+ compare = CompareService.new(user_project, params[:to]).execute(user_project, params[:from], straight: params[:straight])
+
+ if compare
+ present compare, with: Entities::Compare
+ else
+ not_found!("Ref")
+ end
end
desc 'Get repository contributors' do