Commit 2f780af2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Git::Compare does not have limit param any more

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 027fcc05
...@@ -12,7 +12,6 @@ class CompareService ...@@ -12,7 +12,6 @@ class CompareService
target_project.repository.raw_repository, target_project.repository.raw_repository,
target_branch, target_branch,
source_branch, source_branch,
10000
) )
) )
else else
......
...@@ -13,7 +13,7 @@ class EmailsOnPushWorker ...@@ -13,7 +13,7 @@ class EmailsOnPushWorker
return true return true
end end
compare = Gitlab::Git::Compare.new(project.repository.raw_repository, before_sha, after_sha, MergeRequestDiff::COMMITS_SAFE_SIZE) compare = Gitlab::Git::Compare.new(project.repository.raw_repository, before_sha, after_sha)
# Do not send emails if git compare failed # Do not send emails if git compare failed
return false unless compare && compare.commits.present? return false unless compare && compare.commits.present?
......
...@@ -201,13 +201,13 @@ module API ...@@ -201,13 +201,13 @@ module API
class Compare < Grape::Entity class Compare < Grape::Entity
expose :commit, using: Entities::RepoCommit do |compare, options| expose :commit, using: Entities::RepoCommit do |compare, options|
if compare.commit Commit.decorate(compare.commits).last
Commit.new compare.commit
end
end end
expose :commits, using: Entities::RepoCommit do |compare, options| expose :commits, using: Entities::RepoCommit do |compare, options|
Commit.decorate compare.commits Commit.decorate(compare.commits)
end end
expose :diffs, using: Entities::RepoDiff do |compare, options| expose :diffs, using: Entities::RepoDiff do |compare, options|
compare.diffs compare.diffs
end end
......
...@@ -147,7 +147,7 @@ module API ...@@ -147,7 +147,7 @@ module API
get ':id/repository/compare' do get ':id/repository/compare' do
authorize! :download_code, user_project authorize! :download_code, user_project
required_attributes! [:from, :to] required_attributes! [:from, :to]
compare = Gitlab::Git::Compare.new(user_project.repository.raw_repository, params[:from], params[:to], MergeRequestDiff::COMMITS_SAFE_SIZE) compare = Gitlab::Git::Compare.new(user_project.repository.raw_repository, params[:from], params[:to])
present compare, with: Entities::Compare present compare, with: Entities::Compare
end end
......
...@@ -33,7 +33,11 @@ module Gitlab ...@@ -33,7 +33,11 @@ module Gitlab
end end
def compare(repo) def compare(repo)
@compare ||= Gitlab::Git::Compare.new(Gitlab::Git::Repository.new(repo.path), "origin/#{@target_branch}", "source/#{@source_branch}", 10000) @compare ||= Gitlab::Git::Compare.new(
Gitlab::Git::Repository.new(repo.path),
"origin/#{@target_branch}",
"source/#{@source_branch}"
)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment