added method existence checking for UTF-8, thanks to @technoweenie
This commit is contained in:
@@ -158,7 +158,9 @@ module Gollum
|
|||||||
def tree!(sha)
|
def tree!(sha)
|
||||||
tree = @repo.git.native(:ls_tree,
|
tree = @repo.git.native(:ls_tree,
|
||||||
{:r => true, :l => true, :z => true}, sha)
|
{:r => true, :l => true, :z => true}, sha)
|
||||||
tree.force_encoding("UTF-8")
|
if tree.respond_to?(:force_encoding)
|
||||||
|
tree.force_encoding("UTF-8")
|
||||||
|
end
|
||||||
items = tree.split("\0").inject([]) do |memo, line|
|
items = tree.split("\0").inject([]) do |memo, line|
|
||||||
memo << parse_tree_line(line)
|
memo << parse_tree_line(line)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user