From 7c9e9730824a1e160fc81779f2bc1c7e29d0c280 Mon Sep 17 00:00:00 2001 From: Andy Li Date: Mon, 26 Nov 2012 21:54:43 +0800 Subject: [PATCH] Do not detect language if it is a binary file. --- lib/linguist/blob_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index d7f56de5..f250b8c8 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -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.