BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
4a3d1a58
Commit
4a3d1a58
authored
Aug 24, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle case where conflicts aren't on disk yet
parent
7bbb523b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
merge_request.rb
app/models/merge_request.rb
+1
-1
file.rb
lib/gitlab/conflict/file.rb
+11
-0
merge_request_spec.rb
spec/models/merge_request_spec.rb
+7
-0
No files found.
app/models/merge_request.rb
View file @
4a3d1a58
...
...
@@ -778,7 +778,7 @@ class MergeRequest < ActiveRecord::Base
begin
@conflicts_can_be_resolved_in_ui
=
conflicts
.
files
.
each
(
&
:lines
)
rescue
Gitlab
::
Conflict
::
Parser
::
ParserError
,
Gitlab
::
Conflict
::
FileCollection
::
ConflictSideMissing
rescue
Rugged
::
OdbError
,
Gitlab
::
Conflict
::
Parser
::
ParserError
,
Gitlab
::
Conflict
::
FileCollection
::
ConflictSideMissing
@conflicts_can_be_resolved_in_ui
=
false
end
end
...
...
lib/gitlab/conflict/file.rb
View file @
4a3d1a58
...
...
@@ -181,6 +181,17 @@ module Gitlab
sections:
sections
}
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
spec/models/merge_request_spec.rb
View file @
4a3d1a58
...
...
@@ -890,6 +890,13 @@ 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 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
merge_request
=
create_merge_request
(
'conflict-resolvable'
)
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