From 4f55d7f09e37d32bcc8152fcfa4cbed2334aefb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20I=2E=20B=C3=B6ttcher?= Date: Thu, 9 May 2019 22:14:19 +0200 Subject: Do not abort when UTF-8 names appear in commit history. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From /var/log/apache2/error.log: [Thu May 09 22:03:12.703603 2019] [cgi:error] [pid 7418] [client 84.146.220.115:35130] AH01215: …/git/dudle/vcs_git.rb:55:in `split': invalid byte sequence in US-ASCII (ArgumentError): …www/dudle/Kutter/edit_columns.cgi, referer: … --- vcs_git.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcs_git.rb b/vcs_git.rb index fcd70ff..67dfaf2 100644 --- a/vcs_git.rb +++ b/vcs_git.rb @@ -52,7 +52,7 @@ class VCS end def VCS.history - log = runcmd(GITCMD, "log", "--format=format:%s\t%ai").split("\n").reverse + log = runcmd(GITCMD, "log", "--format=format:%s\t%ai").force_encoding('utf-8').split("\n").reverse ret = Log.new log.each_with_index{|s,i| a = s.scan(/^([^\t]*)(.*)$/).flatten -- cgit v1.2.3