From a337b9ba150b515a0e710be9c214326738ed5f8a Mon Sep 17 00:00:00 2001 From: Ian Babrou Date: Fri, 9 Sep 2011 19:24:27 +0400 Subject: [PATCH] added method existence checking for UTF-8, thanks to @technoweenie --- lib/gollum/git_access.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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