Merge pull request #301 from andyli/binary

Do not detect language if it is a binary file.
This commit is contained in:
Ted Nyman
2014-02-16 14:55:07 -08:00

View File

@@ -291,7 +291,7 @@ module Linguist
data = lambda { (binary_mime_type? || binary?) ? "" : self.data }
end
@language = Language.detect(name.to_s, data, mode)
@language = binary? ? nil : Language.detect(name.to_s, data, mode)
end
# Internal: Get the lexer of the blob.