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
Boxiang Sun
gitlab-ce
Commits
4743d194
Commit
4743d194
authored
Sep 07, 2016
by
Sean McGivern
Committed by
Alfredo Sumaran
Oct 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify conflict file JSON creation
parent
7529bbae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
lib/gitlab/conflict/file.rb
lib/gitlab/conflict/file.rb
+15
-7
No files found.
lib/gitlab/conflict/file.rb
View file @
4743d194
...
@@ -9,7 +9,7 @@ module Gitlab
...
@@ -9,7 +9,7 @@ module Gitlab
CONTEXT_LINES
=
3
CONTEXT_LINES
=
3
attr_reader
:merge_file_result
,
:their_path
,
:our_path
,
:our_mode
,
:merge_request
,
:repository
,
:type
attr_reader
:merge_file_result
,
:their_path
,
:our_path
,
:our_mode
,
:merge_request
,
:repository
def
initialize
(
merge_file_result
,
conflict
,
merge_request
:)
def
initialize
(
merge_file_result
,
conflict
,
merge_request
:)
@merge_file_result
=
merge_file_result
@merge_file_result
=
merge_file_result
...
@@ -25,6 +25,12 @@ module Gitlab
...
@@ -25,6 +25,12 @@ module Gitlab
merge_file_result
[
:data
]
merge_file_result
[
:data
]
end
end
def
type
lines
unless
@type
@type
.
inquiry
end
# Array of Gitlab::Diff::Line objects
# Array of Gitlab::Diff::Line objects
def
lines
def
lines
return
@lines
if
defined?
(
@lines
)
return
@lines
if
defined?
(
@lines
)
...
@@ -200,12 +206,14 @@ module Gitlab
...
@@ -200,12 +206,14 @@ module Gitlab
::
File
.
join
(
merge_request
.
diff_refs
.
head_sha
,
our_path
))
::
File
.
join
(
merge_request
.
diff_refs
.
head_sha
,
our_path
))
}
}
if
opts
[
:full_content
]
json_hash
.
tap
do
|
json_hash
|
json_hash
.
merge
(
content:
content
)
if
opts
[
:full_content
]
else
json_hash
[
:content
]
=
content
json_hash
.
merge!
(
sections:
sections
)
if
type
==
'text'
else
json_hash
[
:sections
]
=
sections
if
type
.
text?
json_hash
.
merge
(
type:
type
,
content_path:
content_path
)
json_hash
[
:type
]
=
type
json_hash
[
:content_path
]
=
content_path
end
end
end
end
end
...
...
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