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
254dbad8
Commit
254dbad8
authored
Aug 10, 2016
by
Douwe Maan
Committed by
Fatih Acet
Aug 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug where conflict view would have one too many context sections
parent
83925ef4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/gitlab/conflict/file.rb
lib/gitlab/conflict/file.rb
+4
-2
No files found.
lib/gitlab/conflict/file.rb
View file @
254dbad8
...
...
@@ -72,9 +72,11 @@ module Gitlab
def
sections
return
@sections
if
@sections
chunked_lines
=
lines
.
chunk
{
|
line
|
line
.
type
.
nil?
}
chunked_lines
=
lines
.
chunk
{
|
line
|
line
.
type
.
nil?
}
.
to_a
match_line
=
nil
sections_count
=
chunked_lines
.
size
@sections
=
chunked_lines
.
flat_map
.
with_index
do
|
(
no_conflict
,
lines
),
i
|
section
=
nil
...
...
@@ -82,7 +84,7 @@ module Gitlab
# always shown in full.
if
no_conflict
conflict_before
=
i
>
0
conflict_after
=
chunked_lines
.
peek
conflict_after
=
(
sections_count
-
i
)
>
1
if
conflict_before
&&
conflict_after
# Create a gap in a long context section.
...
...
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