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
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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
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
...
@@ -72,9 +72,11 @@ module Gitlab
def
sections
def
sections
return
@sections
if
@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
match_line
=
nil
sections_count
=
chunked_lines
.
size
@sections
=
chunked_lines
.
flat_map
.
with_index
do
|
(
no_conflict
,
lines
),
i
|
@sections
=
chunked_lines
.
flat_map
.
with_index
do
|
(
no_conflict
,
lines
),
i
|
section
=
nil
section
=
nil
...
@@ -82,7 +84,7 @@ module Gitlab
...
@@ -82,7 +84,7 @@ module Gitlab
# always shown in full.
# always shown in full.
if
no_conflict
if
no_conflict
conflict_before
=
i
>
0
conflict_before
=
i
>
0
conflict_after
=
chunked_lines
.
peek
conflict_after
=
(
sections_count
-
i
)
>
1
if
conflict_before
&&
conflict_after
if
conflict_before
&&
conflict_after
# Create a gap in a long context section.
# 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