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
Léo-Paul Géneau
gitlab-ce
Commits
52b07013
Commit
52b07013
authored
Aug 25, 2016
by
Douwe Maan
Committed by
Ruben Davila
Aug 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '21275-getting-500-error-when-viewing-a-merge-request'
parent
e618ce28
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
2 deletions
+35
-2
CHANGELOG
CHANGELOG
+5
-0
app/models/merge_request.rb
app/models/merge_request.rb
+6
-2
lib/gitlab/conflict/file.rb
lib/gitlab/conflict/file.rb
+11
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+13
-0
No files found.
CHANGELOG
View file @
52b07013
...
@@ -8,6 +8,11 @@ v 8.11.2
...
@@ -8,6 +8,11 @@ v 8.11.2
- Does not halt the GitHub import process when an error occurs. !5763
- Does not halt the GitHub import process when an error occurs. !5763
- Fix file links on project page when default view is Files !5933
- Fix file links on project page when default view is Files !5933
- Fixed enter key in search input not working !5888
- Fixed enter key in search input not working !5888
- Don't show resolve conflicts link before MR status is updated
- Don't prevent viewing the MR when git refs for conflicts can't be found on disk
v 8.11.2 (unreleased)
- Show "Create Merge Request" widget for push events to fork projects on the source project
v 8.11.1
v 8.11.1
- Pulled due to packaging error.
- Pulled due to packaging error.
...
...
app/models/merge_request.rb
View file @
52b07013
...
@@ -777,8 +777,12 @@ class MergeRequest < ActiveRecord::Base
...
@@ -777,8 +777,12 @@ class MergeRequest < ActiveRecord::Base
return
@conflicts_can_be_resolved_in_ui
=
false
unless
has_complete_diff_refs?
return
@conflicts_can_be_resolved_in_ui
=
false
unless
has_complete_diff_refs?
begin
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,
rescue
Gitlab
::
Conflict
::
Parser
::
ParserError
,
Gitlab
::
Conflict
::
FileCollection
::
ConflictSideMissing
# 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
@conflicts_can_be_resolved_in_ui
=
false
end
end
end
end
...
...
lib/gitlab/conflict/file.rb
View file @
52b07013
...
@@ -181,6 +181,17 @@ module Gitlab
...
@@ -181,6 +181,17 @@ module Gitlab
sections:
sections
sections:
sections
}
}
end
end
# Don't try to print merge_request or repository.
def
inspect
instance_variables
=
[
:merge_file_result
,
:their_path
,
:our_path
,
:our_mode
].
map
do
|
instance_variable
|
value
=
instance_variable_get
(
"@
#{
instance_variable
}
"
)
"
#{
instance_variable
}
=
\"
#{
value
}
\"
"
end
"#<
#{
self
.
class
}
#{
instance_variables
.
join
(
' '
)
}
>"
end
end
end
end
end
end
end
spec/models/merge_request_spec.rb
View file @
52b07013
...
@@ -890,6 +890,19 @@ describe MergeRequest, models: true do
...
@@ -890,6 +890,19 @@ describe MergeRequest, models: true do
expect
(
merge_request
.
conflicts_can_be_resolved_in_ui?
).
to
be_falsey
expect
(
merge_request
.
conflicts_can_be_resolved_in_ui?
).
to
be_falsey
end
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
)
expect
(
merge_request
.
conflicts_can_be_resolved_in_ui?
).
to
be_falsey
end
it
'returns a falsey value when the MR does not support new diff notes'
do
it
'returns a falsey value when the MR does not support new diff notes'
do
merge_request
=
create_merge_request
(
'conflict-resolvable'
)
merge_request
=
create_merge_request
(
'conflict-resolvable'
)
merge_request
.
merge_request_diff
.
update_attributes
(
start_commit_sha:
nil
)
merge_request
.
merge_request_diff
.
update_attributes
(
start_commit_sha:
nil
)
...
...
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