@@ -88,7 +88,7 module Redmine | |||
|
88 | 88 | return nil if path.nil? |
|
89 | 89 | cmd = "#{GIT_BIN} --git-dir #{target('')} log --date=iso --pretty=fuller --no-merges -n 1 " |
|
90 | 90 | cmd << " #{shell_quote rev} " if rev |
|
91 | cmd << "-- #{path} " unless path.empty? | |
|
91 | cmd << "-- #{shell_quote path} " unless path.empty? | |
|
92 | 92 | shellout(cmd) do |io| |
|
93 | 93 | begin |
|
94 | 94 | id = io.gets.split[1] |
@@ -121,7 +121,7 module Redmine | |||
|
121 | 121 | cmd << "#{shell_quote(identifier_from + '..')}" if identifier_from |
|
122 | 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 | cmd << " -- #{path}" if path && !path.empty? | |
|
124 | cmd << " -- #{shell_quote path}" if path && !path.empty? | |
|
125 | 125 | |
|
126 | 126 | shellout(cmd) do |io| |
|
127 | 127 | files=[] |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -50,7 +50,7 class RepositoriesGitControllerTest < ActionController::TestCase | |||
|
50 | 50 | assert_response :success |
|
51 | 51 | assert_template 'show' |
|
52 | 52 | assert_not_nil assigns(:entries) |
|
53 |
assert_equal |
|
|
53 | assert_equal 8, assigns(:entries).size | |
|
54 | 54 | assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'} |
|
55 | 55 | assert assigns(:entries).detect {|e| e.name == 'this_is_a_really_long_and_verbose_directory_name' && e.kind == 'dir'} |
|
56 | 56 | assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'} |
@@ -58,6 +58,7 class RepositoriesGitControllerTest < ActionController::TestCase | |||
|
58 | 58 | assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'} |
|
59 | 59 | assert assigns(:entries).detect {|e| e.name == 'new_file.txt' && e.kind == 'file'} |
|
60 | 60 | assert assigns(:entries).detect {|e| e.name == 'renamed_test.txt' && e.kind == 'file'} |
|
61 | assert assigns(:entries).detect {|e| e.name == 'filemane with spaces.txt' && e.kind == 'file'} | |
|
61 | 62 | end |
|
62 | 63 | |
|
63 | 64 | def test_browse_branch |
@@ -13,13 +13,17 class GitAdapterTest < ActiveSupport::TestCase | |||
|
13 | 13 | end |
|
14 | 14 | |
|
15 | 15 | def test_getting_all_revisions |
|
16 |
assert_equal 1 |
|
|
16 | assert_equal 14, @adapter.revisions('',nil,nil,:all => true).length | |
|
17 | 17 | end |
|
18 | 18 | |
|
19 | 19 | def test_getting_certain_revisions |
|
20 | 20 | assert_equal 1, @adapter.revisions('','899a15d^','899a15d').length |
|
21 | 21 | end |
|
22 | 22 | |
|
23 | def test_getting_revisions_with_spaces_in_filename | |
|
24 | assert_equal 1, @adapter.revisions("filemane with spaces.txt", nil, nil, :all => true).length | |
|
25 | end | |
|
26 | ||
|
23 | 27 | def test_annotate |
|
24 | 28 | annotate = @adapter.annotate('sources/watchers_controller.rb') |
|
25 | 29 | assert_kind_of Redmine::Scm::Adapters::Annotate, annotate |
@@ -29,6 +33,12 class GitAdapterTest < ActiveSupport::TestCase | |||
|
29 | 33 | assert_equal "jsmith", annotate.revisions[4].author |
|
30 | 34 | end |
|
31 | 35 | |
|
36 | def test_annotate_moved_file | |
|
37 | annotate = @adapter.annotate('renamed_test.txt') | |
|
38 | assert_kind_of Redmine::Scm::Adapters::Annotate, annotate | |
|
39 | assert_equal 2, annotate.lines.size | |
|
40 | end | |
|
41 | ||
|
32 | 42 | def test_last_rev |
|
33 | 43 | last_rev = @adapter.lastrev("README", "4f26664364207fa8b1af9f8722647ab2d4ac5d43") |
|
34 | 44 | assert_equal "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8", last_rev.scmid |
@@ -37,10 +47,12 class GitAdapterTest < ActiveSupport::TestCase | |||
|
37 | 47 | assert_equal "2009-06-24 05:27:38".to_time, last_rev.time |
|
38 | 48 | end |
|
39 | 49 | |
|
40 | def test_annotate_moved_file | |
|
41 | annotate = @adapter.annotate('renamed_test.txt') | |
|
42 | assert_kind_of Redmine::Scm::Adapters::Annotate, annotate | |
|
43 | assert_equal 2, annotate.lines.size | |
|
50 | def test_last_rev_with_spaces_in_filename | |
|
51 | last_rev = @adapter.lastrev("filemane with spaces.txt", "ed5bb786bbda2dee66a2d50faf51429dbc043a7b") | |
|
52 | assert_equal "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", last_rev.scmid | |
|
53 | assert_equal "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", last_rev.identifier | |
|
54 | assert_equal "Felix Schäfer <felix@fachschaften.org>", last_rev.author | |
|
55 | assert_equal "2010-09-18 19:59:46".to_time, last_rev.time | |
|
44 | 56 | end |
|
45 | 57 | else |
|
46 | 58 | puts "Git test repository NOT FOUND. Skipping unit tests !!!" |
@@ -34,8 +34,8 class RepositoryGitTest < ActiveSupport::TestCase | |||
|
34 | 34 | @repository.fetch_changesets |
|
35 | 35 | @repository.reload |
|
36 | 36 | |
|
37 |
assert_equal 1 |
|
|
38 |
assert_equal 2 |
|
|
37 | assert_equal 14, @repository.changesets.count | |
|
38 | assert_equal 23, @repository.changes.count | |
|
39 | 39 | |
|
40 | 40 | commit = @repository.changesets.find(:first, :order => 'committed_on ASC') |
|
41 | 41 | assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments |
@@ -57,10 +57,10 class RepositoryGitTest < ActiveSupport::TestCase | |||
|
57 | 57 | # Remove the 3 latest changesets |
|
58 | 58 | @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy) |
|
59 | 59 | @repository.reload |
|
60 |
assert_equal 1 |
|
|
60 | assert_equal 11, @repository.changesets.count | |
|
61 | 61 | |
|
62 | 62 | @repository.fetch_changesets |
|
63 |
assert_equal 1 |
|
|
63 | assert_equal 14, @repository.changesets.count | |
|
64 | 64 | end |
|
65 | 65 | else |
|
66 | 66 | puts "Git test repository NOT FOUND. Skipping unit tests !!!" |
General Comments 0
You need to be logged in to leave comments.
Login now