mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Only read lines if blob is viewable
This commit is contained in:
@@ -124,7 +124,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns an Array of lines
|
# Returns an Array of lines
|
||||||
def lines
|
def lines
|
||||||
@lines ||= data ? data.split("\n", -1) : []
|
@lines ||= (viewable? && data) ? data.split("\n", -1) : []
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Get number of lines of code
|
# Public: Get number of lines of code
|
||||||
|
|||||||
Reference in New Issue
Block a user