Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
c581c0fd69ea
Unverified
Commit
2f780af2
authored
Jul 29, 2014
by
Dmitriy Zaporozhets
Browse files
Git::Compare does not have limit param any more
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
a716ea03c0d3
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/services/compare_service.rb
View file @
c581c0fd
...
...
@@ -12,7 +12,6 @@ def execute(current_user, source_project, source_branch, target_project, target_
target_project
.
repository
.
raw_repository
,
target_branch
,
source_branch
,
10000
)
)
else
...
...
app/workers/emails_on_push_worker.rb
View file @
c581c0fd
...
...
@@ -13,7 +13,7 @@ def perform(project_id, recipients, push_data)
return
true
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
return
false
unless
compare
&&
compare
.
commits
.
present?
...
...
lib/api/entities.rb
View file @
c581c0fd
...
...
@@ -201,13 +201,13 @@ class RepoDiff < Grape::Entity
class
Compare
<
Grape
::
Entity
expose
:commit
,
using:
Entities
::
RepoCommit
do
|
compare
,
options
|
if
compare
.
commit
Commit
.
new
compare
.
commit
end
Commit
.
decorate
(
compare
.
commits
).
last
end
expose
:commits
,
using:
Entities
::
RepoCommit
do
|
compare
,
options
|
Commit
.
decorate
compare
.
commits
Commit
.
decorate
(
compare
.
commits
)
end
expose
:diffs
,
using:
Entities
::
RepoDiff
do
|
compare
,
options
|
compare
.
diffs
end
...
...
lib/api/repositories.rb
View file @
c581c0fd
...
...
@@ -147,7 +147,7 @@ def handle_project_member_errors(errors)
get
':id/repository/compare'
do
authorize!
:download_code
,
user_project
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
end
...
...
lib/gitlab/satellite/compare_action.rb
View file @
c581c0fd
...
...
@@ -33,7 +33,11 @@ def update_satellite_source_and_target!(target_repo)
end
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment