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
Tatuya Kamada
gitlab-ce
Commits
5e1e08e5
Commit
5e1e08e5
authored
Aug 10, 2016
by
Douwe Maan
Committed by
Fatih Acet
Aug 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show appropriate message when conflicts have already been resolved
parent
9eca67c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+13
-1
app/views/projects/merge_requests/conflicts.html.haml
app/views/projects/merge_requests/conflicts.html.haml
+6
-6
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
5e1e08e5
...
...
@@ -139,9 +139,14 @@ class Projects::MergeRequestsController < Projects::ApplicationController
format
.
json
do
if
@merge_request
.
conflicts_can_be_resolved_in_ui?
render
json:
@merge_request
.
conflicts
elsif
@merge_request
.
can_be_merged?
render
json:
{
message:
'The merge conflicts for this merge request have already been resolved. Please return to the merge request.'
,
type:
'error'
}
else
render
json:
{
message:
'
Unable to resolve conflicts in the web interface for this merge request
.'
,
message:
'
The merge conflicts for this merge request cannot be resolved through GitLab. Please try to resolve them locally
.'
,
type:
'error'
}
end
...
...
@@ -150,6 +155,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def
resolve_conflicts
return
render_404
unless
@merge_request
.
conflicts_can_be_resolved_in_ui?
if
@merge_request
.
can_be_merged?
render
status: :bad_request
,
json:
{
message:
'The merge conflicts for this merge request have already been resolved.'
}
return
end
begin
MergeRequests
::
ResolveService
.
new
(
project
,
current_user
,
params
).
execute
(
@merge_request
)
...
...
app/views/projects/merge_requests/conflicts.html.haml
View file @
5e1e08e5
...
...
@@ -17,12 +17,12 @@
.loading
{
"v-if"
=>
"isLoading"
}
%i
.fa.fa-spinner.fa-spin
.
content-block.onelin
e-block
{
"v-if"
=>
"hasError"
}
%p
{{conflictsData.errorMessage}}
.
nothing-her
e-block
{
"v-if"
=>
"hasError"
}
{{conflictsData.errorMessage}}
=
render
partial:
"projects/merge_requests/conflicts/commit_stats
.html.haml
"
=
render
partial:
"projects/merge_requests/conflicts/commit_stats"
.files-wrapper
{
"v-if"
=>
"!isLoading && !hasError"
}
=
render
partial:
"projects/merge_requests/conflicts/parallel_view
.html.haml
"
,
locals:
{
class_bindings:
class_bindings
}
=
render
partial:
"projects/merge_requests/conflicts/inline_view
.html.haml
"
,
locals:
{
class_bindings:
class_bindings
}
=
render
partial:
"projects/merge_requests/conflicts/submit_form
.html.haml
"
=
render
partial:
"projects/merge_requests/conflicts/parallel_view"
,
locals:
{
class_bindings:
class_bindings
}
=
render
partial:
"projects/merge_requests/conflicts/inline_view"
,
locals:
{
class_bindings:
class_bindings
}
=
render
partial:
"projects/merge_requests/conflicts/submit_form"
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