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
193a5ed3
Commit
193a5ed3
authored
Jan 22, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render MR diff correctly
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
79bfbe59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
app/views/projects/merge_requests/show/_diffs.html.haml
app/views/projects/merge_requests/show/_diffs.html.haml
+4
-4
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
193a5ed3
...
@@ -213,6 +213,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -213,6 +213,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
# or from cache if already merged
# or from cache if already merged
@commits
=
@merge_request
.
commits
@commits
=
@merge_request
.
commits
@merge_request_diff
=
@merge_request
.
merge_request_diff
@allowed_to_merge
=
allowed_to_merge?
@allowed_to_merge
=
allowed_to_merge?
@show_merge_controls
=
@merge_request
.
opened?
&&
@commits
.
any?
&&
@allowed_to_merge
@show_merge_controls
=
@merge_request
.
opened?
&&
@commits
.
any?
&&
@allowed_to_merge
end
end
...
...
app/views/projects/merge_requests/show/_diffs.html.haml
View file @
193a5ed3
-
if
@merge_request
.
valid_diffs
?
-
if
@merge_request
_diff
.
collected
?
=
render
"projects/commits/diffs"
,
diffs:
@merge_request
.
diffs
,
project:
@merge_request
.
source_project
=
render
"projects/commits/diffs"
,
diffs:
@merge_request
.
diffs
,
project:
@merge_request
.
source_project
-
elsif
@merge_request
.
broken_diffs?
-
elsif
@merge_request_diff
.
empty?
%h4
.nothing_here_message
Nothing to merge from
#{
@merge_request
.
source_branch
}
into
#{
@merge_request
.
target_branch
}
-
else
%h4
.nothing_here_message
%h4
.nothing_here_message
Can't load diff.
Can't load diff.
You can
You can
=
link_to
"download it"
,
project_merge_request_path
(
@merge_request
.
source_project
,
@merge_request
),
format: :diff
,
class:
"vlink"
=
link_to
"download it"
,
project_merge_request_path
(
@merge_request
.
source_project
,
@merge_request
),
format: :diff
,
class:
"vlink"
instead.
instead.
-
else
%h4
.nothing_here_message
Nothing to merge
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