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
Boxiang Sun
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
def
diff_for_path
return
render_404
unless
@compare
render_diff_for_path
(
@compare
.
diffs
(
diff_options
:
diff_options
))
render_diff_for_path
(
@compare
.
diffs
(
diff_options
))
end
def
create
...
...
@@ -45,7 +45,7 @@ class Projects::CompareController < Projects::ApplicationController
@commit
=
@compare
.
commit
@base_commit
=
@compare
.
base_commit
@diffs
=
@compare
.
diffs
(
diff_options
:
diff_options
)
@diffs
=
@compare
.
diffs
(
diff_options
)
@diff_notes_disabled
=
true
@grouped_diff_discussions
=
{}
...
...
app/models/compare.rb
View file @
c008a1a9
...
...
@@ -49,7 +49,7 @@ class Compare
@compare
.
diffs
(
*
args
)
end
def
diffs
(
diff_options
:
)
def
diffs
(
diff_options
=
nil
)
Gitlab
::
Diff
::
FileCollection
::
Compare
.
new
(
self
,
project:
project
,
diff_options:
diff_options
,
...
...
app/models/merge_request.rb
View file @
c008a1a9
...
...
@@ -170,7 +170,7 @@ class MergeRequest < ActiveRecord::Base
def
diffs
(
diff_options
=
nil
)
if
self
.
compare
self
.
compare
.
diffs
(
diff_options
:
diff_options
)
self
.
compare
.
diffs
(
diff_options
)
else
Gitlab
::
Diff
::
FileCollection
::
MergeRequest
.
new
(
self
,
diff_options:
diff_options
)
end
...
...
lib/gitlab/email/message/repository_push.rb
View file @
c008a1a9
...
...
@@ -42,7 +42,7 @@ module Gitlab
return
unless
compare
# 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
def
diffs_count
...
...
spec/models/merge_request_spec.rb
View file @
c008a1a9
...
...
@@ -171,7 +171,7 @@ describe MergeRequest, models: true do
it
'delegates to the compare object'
do
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
)
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