Commit dbaed90c authored by micael.bergeron's avatar micael.bergeron

fix refactoring error with Blob.binary?

remove some lint
parent 5625b0e4
......@@ -33,12 +33,12 @@ module Gitlab
# encode and clean the bad chars
message.replace clean(message)
rescue => e
rescue
encoding = detect ? detect[:encoding] : "unknown"
"--broken encoding: #{encoding}"
end
def all_binary?(data, detect=nil)
def all_binary?(data, detect = nil)
detect ||= CharlockHolmes::EncodingDetector.detect(data)
detect && detect[:type] == :binary
end
......
......@@ -57,6 +57,10 @@ module Gitlab
end
end
def binary?(data)
EncodingHelper.libgit2_binary?(data)
end
private
# Recursive search of blob id by path
......@@ -161,10 +165,6 @@ module Gitlab
end
end
end
def binary?(data)
EncodingHelper.libgit2_binary?(data)
end
end
def initialize(options)
......
......@@ -201,7 +201,7 @@ module Gitlab
return @diff unless all_binary?(@diff)
# the diff is binary, let's make a message for it
Diff::binary_message(@old_path, @new_path)
Diff.binary_message(@old_path, @new_path)
end
private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment