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
bc4fec1f
Commit
bc4fec1f
authored
May 15, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove @commit in compare and MR controllers
parent
7c479d88
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
11 deletions
+4
-11
app/controllers/projects/compare_controller.rb
app/controllers/projects/compare_controller.rb
+1
-4
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-7
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+3
-0
No files found.
app/controllers/projects/compare_controller.rb
View file @
bc4fec1f
...
@@ -51,12 +51,9 @@ class Projects::CompareController < Projects::ApplicationController
...
@@ -51,12 +51,9 @@ class Projects::CompareController < Projects::ApplicationController
if
@compare
if
@compare
@commits
=
@compare
.
commits
@commits
=
@compare
.
commits
@start_commit
=
@compare
.
start_commit
@commit
=
@compare
.
commit
@diffs
=
@compare
.
diffs
(
diff_options
)
@diffs
=
@compare
.
diffs
(
diff_options
)
environment_params
=
@repository
.
branch_exists?
(
@head_ref
)
?
{
ref:
@head_ref
}
:
{
commit:
@commit
}
environment_params
=
@repository
.
branch_exists?
(
@head_ref
)
?
{
ref:
@head_ref
}
:
{
commit:
@com
pare
.
com
mit
}
@environment
=
EnvironmentsFinder
.
new
(
@project
,
current_user
,
environment_params
).
execute
.
last
@environment
=
EnvironmentsFinder
.
new
(
@project
,
current_user
,
environment_params
).
execute
.
last
@diff_notes_disabled
=
true
@diff_notes_disabled
=
true
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
bc4fec1f
...
@@ -14,7 +14,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -14,7 +14,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
]
]
before_action
:validates_merge_request
,
only:
[
:show
,
:diffs
,
:commits
,
:pipelines
]
before_action
:validates_merge_request
,
only:
[
:show
,
:diffs
,
:commits
,
:pipelines
]
before_action
:define_show_vars
,
only:
[
:diffs
,
:commits
,
:conflicts
,
:conflict_for_path
,
:builds
,
:pipelines
]
before_action
:define_show_vars
,
only:
[
:diffs
,
:commits
,
:conflicts
,
:conflict_for_path
,
:builds
,
:pipelines
]
before_action
:define_commit_vars
,
only:
[
:diffs
]
before_action
:ensure_ref_fetched
,
only:
[
:show
,
:diffs
,
:commits
,
:builds
,
:conflicts
,
:conflict_for_path
,
:pipelines
]
before_action
:ensure_ref_fetched
,
only:
[
:show
,
:diffs
,
:commits
,
:builds
,
:conflicts
,
:conflict_for_path
,
:pipelines
]
before_action
:close_merge_request_without_source_project
,
only:
[
:show
,
:diffs
,
:commits
,
:builds
,
:pipelines
]
before_action
:close_merge_request_without_source_project
,
only:
[
:show
,
:diffs
,
:commits
,
:builds
,
:pipelines
]
before_action
:check_if_can_be_merged
,
only: :show
before_action
:check_if_can_be_merged
,
only: :show
...
@@ -130,8 +129,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -130,8 +129,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@diff_notes_disabled
=
true
@diff_notes_disabled
=
true
end
end
define_commit_vars
render_diff_for_path
(
@diffs
)
render_diff_for_path
(
@diffs
)
end
end
...
@@ -500,10 +497,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -500,10 +497,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@notes
=
prepare_notes_for_rendering
(
@discussions
.
flat_map
(
&
:notes
))
@notes
=
prepare_notes_for_rendering
(
@discussions
.
flat_map
(
&
:notes
))
end
end
def
define_commit_vars
@commit
=
@merge_request
.
diff_head_commit
end
def
define_diff_vars
def
define_diff_vars
@merge_request_diff
=
@merge_request_diff
=
if
params
[
:diff_id
]
if
params
[
:diff_id
]
...
...
app/models/merge_request_diff.rb
View file @
bc4fec1f
...
@@ -159,6 +159,9 @@ class MergeRequestDiff < ActiveRecord::Base
...
@@ -159,6 +159,9 @@ class MergeRequestDiff < ActiveRecord::Base
# It is not good enough for highlighting diffs, so we can't simply pass
# It is not good enough for highlighting diffs, so we can't simply pass
# these as `diff_refs.`
# these as `diff_refs.`
def
fallback_diff_refs
def
fallback_diff_refs
real_refs
=
diff_refs
return
real_refs
if
real_refs
likely_base_commit_sha
=
(
first_commit
&
.
parent
||
first_commit
)
&
.
sha
likely_base_commit_sha
=
(
first_commit
&
.
parent
||
first_commit
)
&
.
sha
Gitlab
::
Diff
::
DiffRefs
.
new
(
Gitlab
::
Diff
::
DiffRefs
.
new
(
...
...
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