aboutsummaryrefslogtreecommitdiff
path: root/vcs_git.rb
diff options
context:
space:
mode:
authorStephan I. Böttcher <stephan@vps.psjt.org>2019-05-09 22:14:19 +0200
committerStephan I. Böttcher <stephan@vps.psjt.org>2019-05-09 22:14:19 +0200
commit4f55d7f09e37d32bcc8152fcfa4cbed2334aefb3 (patch)
tree94d455f90834cf354dd6f0b405482a0dc965ce82 /vcs_git.rb
parent89afd0a64110710c135b558614cdd755a181349b (diff)
Do not abort when UTF-8 names appear in commit history.
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: …
Diffstat (limited to 'vcs_git.rb')
-rw-r--r--vcs_git.rb2
1 files changed, 1 insertions, 1 deletions
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