summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-08 23:38:35 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-08 23:38:35 +0000
commit34b3a9851f6a0c78c9b057c80ea778d3b5d8c5a3 (patch)
tree6b129b56b59973b9f1cfa8d579a9ab13aa48acd8 /lib/redmine/scm
parentadb81b1ff6740cdf8c37454d2f691950306330cc (diff)
downloadredmine-34b3a9851f6a0c78c9b057c80ea778d3b5d8c5a3.tar.gz
redmine-34b3a9851f6a0c78c9b057c80ea778d3b5d8c5a3.zip
scm: git: add includes and excludes options to lib revisions method (#8857)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8815 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/scm')
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index b6ab394c3..d6c554461 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -193,9 +193,17 @@ module Redmine
cmd_args << "--reverse" if options[:reverse]
cmd_args << "-n" << "#{options[:limit].to_i}" if options[:limit]
from_to = ""
- from_to << "#{identifier_from}.." if identifier_from
- from_to << "#{identifier_to}" if identifier_to
- cmd_args << from_to if !from_to.empty?
+ if identifier_from || identifier_to
+ from_to << "#{identifier_from}.." if identifier_from
+ from_to << "#{identifier_to}" if identifier_to
+ cmd_args << from_to if !from_to.empty?
+ else
+ cmd_args += options[:includes] unless options[:includes].blank?
+ unless options[:excludes].blank?
+ cmd_args << "--not"
+ cmd_args += options[:excludes]
+ end
+ end
cmd_args << "--" << scm_iconv(@path_encoding, 'UTF-8', path) if path && !path.empty?
scm_cmd *cmd_args do |io|