-
Notifications
You must be signed in to change notification settings - Fork 51
Fix branch name encoding issue #25
Fix branch name encoding issue #25
Conversation
It's better to treat the branch name as utf-8 than ascii. Hm, how does this build failed? |
It's failed in ruby 1.9.3 but succeed in ruby 2.0. Does it concerned with this pull request? |
@randx Lots of people are encountering problems with non-ascii branch names that this should fix. Can you review it? |
@@ -295,6 +295,7 @@ def find_commits(options = {}) | |||
# | |||
def branch_names_contains(commit) | |||
output = grit.git.native(:branch, {contains: true}, commit) | |||
output.force_encoding("UTF-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use existing encoding helper output = EncodingHelper.encode!(output)
?
Sorry for commit three times. I'm really a novice to ruby. I'm test it with gitlab 6.5.1 in Ubuntu12.04. It works fine. |
That's a really good solution. |
@layzerar Can you adapt your PR? |
@dosire Yes. But I don't have test environment now. I'm afraid I couldn't change it until tomorrow. |
@layzerar No problem, tomorrow is fine. |
I adapted the pull request just now. I tested it in my machine, it works fine. |
@randx Looks good to me. |
Fix branch name encoding issue
When the branch name contains non-ascii characters, it will raise a encoding error when viewing any commit of this branch.
Here is the detail of traceback.