Project

General

Profile

Defect #5628 » 5628_git.diff

Jean-Baptiste Barth, 2010-06-26 11:45

View differences:

lib/redmine/scm/adapters/git_adapter.rb
114 114
        def revisions(path, identifier_from, identifier_to, options={})
115 115
          revisions = Revisions.new
116 116

  
117
          cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller"
118
          cmd << " --reverse" if options[:reverse]
119
          cmd << " --all" if options[:all]
117
          cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller "
118
          cmd << " --reverse " if options[:reverse]
119
          cmd << " --all " if options[:all]
120 120
          cmd << " -n #{options[:limit]} " if options[:limit]
121
          cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from
122
          cmd << " #{shell_quote identifier_to} " if identifier_to
121
          cmd << "#{shell_quote(identifier_from + '..')}" if identifier_from
122
          cmd << "#{shell_quote identifier_to}" if identifier_to
123 123
          cmd << " --since=#{shell_quote(options[:since].strftime("%Y-%m-%d %H:%M:%S"))}" if options[:since]
124 124
          cmd << " -- #{path}" if path && !path.empty?
125 125

  
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
16 16
      assert_equal 12, @adapter.revisions('',nil,nil,:all => true).length
17 17
    end
18 18
    
19
    def test_getting_certain_revisions
20
      assert_equal 1, @adapter.revisions('','899a15d^','899a15d').length
21
    end
22
    
19 23
    def test_annotate
20 24
      annotate = @adapter.annotate('sources/watchers_controller.rb')
21 25
      assert_kind_of Redmine::Scm::Adapters::Annotate, annotate
(2-2/2)