加入分支参数
This commit is contained in:
parent
ea03386ec1
commit
bf5f7f8d4f
|
@ -38,8 +38,8 @@ class Repository::Git < Repository
|
|||
'Git'
|
||||
end
|
||||
|
||||
def commits(authors, start_date, end_date)
|
||||
scm.commits(authors, start_date, end_date).map {|commit|
|
||||
def commits(authors, start_date, end_date, branch='master')
|
||||
scm.commits(authors, start_date, end_date,branch).map {|commit|
|
||||
[commit[:author], commit[:num]]
|
||||
}
|
||||
end
|
||||
|
|
|
@ -396,10 +396,10 @@ module Redmine
|
|||
sum[:insertion] + sum[:deletion]
|
||||
end
|
||||
|
||||
def commits(authors, start_date, end_date)
|
||||
def commits(authors, start_date, end_date, branch='master')
|
||||
rs = []
|
||||
authors.each do |author|
|
||||
cmd_args = %W|log --pretty=tformat: --shortstat --author=#{author} --since=#{start_date} --until=#{end_date}|
|
||||
cmd_args = %W|log #{branch} --pretty=tformat: --shortstat --author=#{author} --since=#{start_date} --until=#{end_date}|
|
||||
commits = ''
|
||||
git_cmd(cmd_args) do |io|
|
||||
commits = io.read
|
||||
|
|
Loading…
Reference in New Issue