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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c008a1a9
Commit
c008a1a9
authored
Aug 03, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Compare#diffs diff_options a regular argument
parent
c86c1905
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
app/controllers/projects/compare_controller.rb
app/controllers/projects/compare_controller.rb
+2
-2
app/models/compare.rb
app/models/compare.rb
+1
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
lib/gitlab/email/message/repository_push.rb
lib/gitlab/email/message/repository_push.rb
+1
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+1
-1
No files found.
app/controllers/projects/compare_controller.rb
View file @
c008a1a9
...
@@ -21,7 +21,7 @@ class Projects::CompareController < Projects::ApplicationController
...
@@ -21,7 +21,7 @@ class Projects::CompareController < Projects::ApplicationController
def
diff_for_path
def
diff_for_path
return
render_404
unless
@compare
return
render_404
unless
@compare
render_diff_for_path
(
@compare
.
diffs
(
diff_options
:
diff_options
))
render_diff_for_path
(
@compare
.
diffs
(
diff_options
))
end
end
def
create
def
create
...
@@ -45,7 +45,7 @@ class Projects::CompareController < Projects::ApplicationController
...
@@ -45,7 +45,7 @@ class Projects::CompareController < Projects::ApplicationController
@commit
=
@compare
.
commit
@commit
=
@compare
.
commit
@base_commit
=
@compare
.
base_commit
@base_commit
=
@compare
.
base_commit
@diffs
=
@compare
.
diffs
(
diff_options
:
diff_options
)
@diffs
=
@compare
.
diffs
(
diff_options
)
@diff_notes_disabled
=
true
@diff_notes_disabled
=
true
@grouped_diff_discussions
=
{}
@grouped_diff_discussions
=
{}
...
...
app/models/compare.rb
View file @
c008a1a9
...
@@ -49,7 +49,7 @@ class Compare
...
@@ -49,7 +49,7 @@ class Compare
@compare
.
diffs
(
*
args
)
@compare
.
diffs
(
*
args
)
end
end
def
diffs
(
diff_options
:
)
def
diffs
(
diff_options
=
nil
)
Gitlab
::
Diff
::
FileCollection
::
Compare
.
new
(
self
,
Gitlab
::
Diff
::
FileCollection
::
Compare
.
new
(
self
,
project:
project
,
project:
project
,
diff_options:
diff_options
,
diff_options:
diff_options
,
...
...
app/models/merge_request.rb
View file @
c008a1a9
...
@@ -170,7 +170,7 @@ class MergeRequest < ActiveRecord::Base
...
@@ -170,7 +170,7 @@ class MergeRequest < ActiveRecord::Base
def
diffs
(
diff_options
=
nil
)
def
diffs
(
diff_options
=
nil
)
if
self
.
compare
if
self
.
compare
self
.
compare
.
diffs
(
diff_options
:
diff_options
)
self
.
compare
.
diffs
(
diff_options
)
else
else
Gitlab
::
Diff
::
FileCollection
::
MergeRequest
.
new
(
self
,
diff_options:
diff_options
)
Gitlab
::
Diff
::
FileCollection
::
MergeRequest
.
new
(
self
,
diff_options:
diff_options
)
end
end
...
...
lib/gitlab/email/message/repository_push.rb
View file @
c008a1a9
...
@@ -42,7 +42,7 @@ module Gitlab
...
@@ -42,7 +42,7 @@ module Gitlab
return
unless
compare
return
unless
compare
# This diff is more moderated in number of files and lines
# This diff is more moderated in number of files and lines
@diffs
||=
compare
.
diffs
(
diff_options:
{
max_files:
30
,
max_lines:
5000
,
no_collapse:
true
}
).
diff_files
@diffs
||=
compare
.
diffs
(
max_files:
30
,
max_lines:
5000
,
no_collapse:
true
).
diff_files
end
end
def
diffs_count
def
diffs_count
...
...
spec/models/merge_request_spec.rb
View file @
c008a1a9
...
@@ -171,7 +171,7 @@ describe MergeRequest, models: true do
...
@@ -171,7 +171,7 @@ describe MergeRequest, models: true do
it
'delegates to the compare object'
do
it
'delegates to the compare object'
do
merge_request
.
compare
=
double
(
:compare
)
merge_request
.
compare
=
double
(
:compare
)
expect
(
merge_request
.
compare
).
to
receive
(
:diffs
).
with
(
diff_options:
options
)
expect
(
merge_request
.
compare
).
to
receive
(
:diffs
).
with
(
options
)
merge_request
.
diffs
(
options
)
merge_request
.
diffs
(
options
)
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