]> source.dussan.org Git - redmine.git/commitdiff
Fixed wrong commit range in git log command. #5628
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Sun, 8 Aug 2010 07:07:30 +0000 (07:07 +0000)
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Sun, 8 Aug 2010 07:07:30 +0000 (07:07 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3925 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/git_adapter.rb
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb

index d15bce1afd6d62cee38083478f320e78cd434496..0857d90471651723b5935cf4be591bf8199cbdde 100644 (file)
@@ -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?
 
index 2dc5d3e8e63f4b6ccd3c8a6e1c4be19f24fec8cc..6b716b9cd25e29d0407c985b5f5858f7b73ea6d6 100644 (file)
@@ -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