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
1bc0e9e3
Commit
1bc0e9e3
authored
Nov 06, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply additional guard-clauses for unfold_required?
parent
ec66ef1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
lib/gitlab/diff/lines_unfolder.rb
lib/gitlab/diff/lines_unfolder.rb
+2
-1
No files found.
lib/gitlab/diff/lines_unfolder.rb
View file @
1bc0e9e3
...
...
@@ -54,7 +54,8 @@ module Gitlab
def
unfold_required?
strong_memoize
(
:unfold_required
)
do
next
false
unless
@diff_file
.
text?
next
false
if
@blob
.
nil?
next
false
unless
@position
.
unchanged?
next
false
if
@diff_file
.
new_file?
||
@diff_file
.
deleted_file?
next
false
unless
@position
.
old_line
# Invalid position (MR import scenario)
next
false
if
@position
.
old_line
>
@blob
.
lines
.
size
...
...
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