Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
2f780af2
Commit
2f780af2
authored
Jul 29, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Git::Compare does not have limit param any more
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
027fcc05
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
8 deletions
+11
-8
app/services/compare_service.rb
app/services/compare_service.rb
+0
-1
app/workers/emails_on_push_worker.rb
app/workers/emails_on_push_worker.rb
+1
-1
lib/api/entities.rb
lib/api/entities.rb
+4
-4
lib/api/repositories.rb
lib/api/repositories.rb
+1
-1
lib/gitlab/satellite/compare_action.rb
lib/gitlab/satellite/compare_action.rb
+5
-1
No files found.
app/services/compare_service.rb
View file @
2f780af2
...
@@ -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
...
...
app/workers/emails_on_push_worker.rb
View file @
2f780af2
...
@@ -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?
...
...
lib/api/entities.rb
View file @
2f780af2
...
@@ -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
...
...
lib/api/repositories.rb
View file @
2f780af2
...
@@ -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
...
...
lib/gitlab/satellite/compare_action.rb
View file @
2f780af2
...
@@ -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
...
...
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