diff --git a/lib/gollum/git_access.rb b/lib/gollum/git_access.rb index 3df2bc89..7e67010b 100644 --- a/lib/gollum/git_access.rb +++ b/lib/gollum/git_access.rb @@ -158,7 +158,9 @@ module Gollum def tree!(sha) tree = @repo.git.native(:ls_tree, {: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| memo << parse_tree_line(line) end