Do not detect language if it is a binary file.

This commit is contained in:
Andy Li
2012-11-26 21:54:43 +08:00
parent d92d208a45
commit 7c9e973082

View File

@@ -305,7 +305,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.