Project

General

Profile

Actions

Defect #16881

closed

Git: repository page crashes when non-ascii character in tag or branch name

Added by qu al over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Toshi MARUYAMA
Category:
SCM
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

If tag or branch name in git contains non-ascii character(ex."あ","い",etc.), Repository page crashes with the following messages in the production.log:

Started GET "/redmine/projects/XXX-000000/repository/git" for 127.0.0.1 at 2014-05-13 09:04:03 +0900
Processing by RepositoriesController#show as HTML
  Parameters: {"id"=>"XXX-000000", "repository_id"=>"git"}
  Current user: YYYYY (id=6)
  Rendered repositories/_navigation.html.erb (93.8ms)
  Rendered repositories/show.html.erb within layouts/base (93.8ms)
Completed 500 Internal Server Error in 812.5ms

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
  app/views/repositories/_navigation.html.erb:24:in `block in _app_views_repositories__navigation_html_erb__875303464_30435480'
  app/views/repositories/_navigation.html.erb:13:in `_app_views_repositories__navigation_html_erb__875303464_30435480'
  app/views/repositories/show.html.erb:4:in `_app_views_repositories_show_html_erb___1026796241_22987116'
  app/controllers/repositories_controller.rb:125:in `show'

Atatched patch fixed the problem for me, but I'm not sure if it is a correct solution.
Environment:
  Redmine version                2.4.1.stable
  Ruby version                   1.9.3-p231 (2012-05-25) [i386-mingw32]
  Rails version                  3.2.16
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            1.8.3

Files

git_adapter.rb.patch (1.14 KB) git_adapter.rb.patch qu al, 2014-05-14 05:40
git_adapter.rb.patch (1.15 KB) git_adapter.rb.patch Patch for Redmine 3.0 Tobias Fischer, 2015-06-03 19:43
branches.png (50.4 KB) branches.png Toshi MARUYAMA, 2019-04-30 10:34
log.txt (1.06 KB) log.txt Toshi MARUYAMA, 2019-04-30 10:34
branch-click.png (66.2 KB) branch-click.png Toshi MARUYAMA, 2019-04-30 10:34
tags.png (49.1 KB) tags.png Toshi MARUYAMA, 2019-04-30 10:34

Related issues

Related to Redmine - Patch #30827: git tags can't handle utf-8Closed

Actions
Has duplicate Redmine - Defect #21141: Git tags and branches need to be UTF-8 encodedClosed

Actions
Actions

Also available in: Atom PDF