Defect #16881 » git_adapter.rb.patch
| lib/redmine/scm/adapters/git_adapter.rb Wed May 14 10:55:15 2014 | ||
|---|---|---|
| 82 | 82 |
return @branches if @branches |
| 83 | 83 |
@branches = [] |
| 84 | 84 |
cmd_args = %w|branch --no-color --verbose --no-abbrev| |
| 85 | 85 |
git_cmd(cmd_args) do |io| |
| 86 | 86 |
io.each_line do |line| |
| 87 |
branch_rev = line.match('\s*(\*?)\s*(.*?)\s*([0-9a-f]{40}).*$')
|
|
| 87 |
branch_rev = line.force_encoding('UTF-8').match('\s*(\*?)\s*(.*?)\s*([0-9a-f]{40}).*$')
|
|
| 88 | 88 |
bran = GitBranch.new(branch_rev[2]) |
| 89 | 89 |
bran.revision = branch_rev[3] |
| 90 | 90 |
bran.scmid = branch_rev[3] |
| 91 | 91 |
bran.is_default = ( branch_rev[1] == '*' ) |
| 92 | 92 |
@branches << bran |
| ... | ... | |
| 99 | 99 |
|
| 100 | 100 |
def tags |
| 101 | 101 |
return @tags if @tags |
| 102 | 102 |
cmd_args = %w|tag| |
| 103 | 103 |
git_cmd(cmd_args) do |io| |
| 104 |
@tags = io.readlines.sort!.map{|t| t.strip}
|
|
| 104 |
@tags = io.readlines.sort!.map{|t| t.strip.force_encoding('UTF-8')}
|
|
| 105 | 105 |
end |
| 106 | 106 |
rescue ScmCommandAborted |
| 107 | 107 |
nil |
| 108 | 108 |
end |
| 109 | 109 |
|