Commit 5d53f7f0 authored by tmaruyama's avatar tmaruyama

scm: git: lib: return array of Branch class instead of array of strings at branches method (#5501)

Contributed by Jan Topiński.

git-svn-id: e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f4ee811d
......@@ -77,10 +77,14 @@ module Redmine
def branches
return @branches if @branches
@branches = []
cmd_args = %w|branch --no-color|
cmd_args = %w|branch --no-color --verbose --no-abbrev|
scm_cmd(*cmd_args) do |io|
io.each_line do |line|
@branches << line.match('\s*\*?\s*(.*)$')[1]
branch_rev = line.match('\s*\*?\s*(.*?)\s*([0-9a-f]{40}).*$')
bran =[1])
bran.revision = branch_rev[2]
bran.scmid = branch_rev[2]
@branches << bran
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment