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
67beaf6f
Commit
67beaf6f
authored
8 years ago
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't show conflicts when there are none
parent
4a3d1a58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
app/models/merge_request.rb
app/models/merge_request.rb
+5
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+6
-0
No files found.
app/models/merge_request.rb
View file @
67beaf6f
...
...
@@ -777,7 +777,11 @@ class MergeRequest < ActiveRecord::Base
return
@conflicts_can_be_resolved_in_ui
=
false
unless
has_complete_diff_refs?
begin
@conflicts_can_be_resolved_in_ui
=
conflicts
.
files
.
each
(
&
:lines
)
# Try to parse each conflict. If the MR's mergeable status hasn't been updated,
# ensure that we don't say there are conflicts to resolve when there are no conflict
# files.
conflicts
.
files
.
each
(
&
:lines
)
@conflicts_can_be_resolved_in_ui
=
conflicts
.
files
.
length
>
0
rescue
Rugged
::
OdbError
,
Gitlab
::
Conflict
::
Parser
::
ParserError
,
Gitlab
::
Conflict
::
FileCollection
::
ConflictSideMissing
@conflicts_can_be_resolved_in_ui
=
false
end
...
...
This diff is collapsed.
Click to expand it.
spec/models/merge_request_spec.rb
View file @
67beaf6f
...
...
@@ -890,6 +890,12 @@ describe MergeRequest, models: true do
expect
(
merge_request
.
conflicts_can_be_resolved_in_ui?
).
to
be_falsey
end
it
'returns a falsey value when the MR is marked as having conflicts, but has none'
do
merge_request
=
create_merge_request
(
'master'
)
expect
(
merge_request
.
conflicts_can_be_resolved_in_ui?
).
to
be_falsey
end
it
'returns a falsey value when the MR has a missing ref after a force push'
do
merge_request
=
create_merge_request
(
'conflict-resolvable'
)
allow
(
merge_request
.
conflicts
).
to
receive
(
:merge_index
).
and_raise
(
Rugged
::
OdbError
)
...
...
This diff is collapsed.
Click to expand it.
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