summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb10
-rw-r--r--test/unit/lib/redmine/scm/adapters/git_adapter_test.rb4
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index d15bce1af..0857d9047 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -114,12 +114,12 @@ module Redmine
def revisions(path, identifier_from, identifier_to, options={})
revisions = Revisions.new
- cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller"
- cmd << " --reverse" if options[:reverse]
- cmd << " --all" if options[:all]
+ cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller "
+ cmd << " --reverse " if options[:reverse]
+ cmd << " --all " if options[:all]
cmd << " -n #{options[:limit]} " if options[:limit]
- cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from
- cmd << " #{shell_quote identifier_to} " if identifier_to
+ cmd << "#{shell_quote(identifier_from + '..')}" if identifier_from
+ cmd << "#{shell_quote identifier_to}" if identifier_to
cmd << " --since=#{shell_quote(options[:since].strftime("%Y-%m-%d %H:%M:%S"))}" if options[:since]
cmd << " -- #{path}" if path && !path.empty?
diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
index 2dc5d3e8e..6b716b9cd 100644
--- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
@@ -16,6 +16,10 @@ class GitAdapterTest < ActiveSupport::TestCase
assert_equal 13, @adapter.revisions('',nil,nil,:all => true).length
end
+ def test_getting_certain_revisions
+ assert_equal 1, @adapter.revisions('','899a15d^','899a15d').length
+ end
+
def test_annotate
annotate = @adapter.annotate('sources/watchers_controller.rb')
assert_kind_of Redmine::Scm::Adapters::Annotate, annotate