git_adapter.rb.patch

Patch for Redmine 3.0 - Tobias Fischer, 2015-06-03 19:43

Download (1.15 KB)

View differences:

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