@@ -65,7 +65,7 module Redmine | |||
|
65 | 65 | shellout(cmd) do |io| |
|
66 | 66 | io.each_line do |line| |
|
67 | 67 | e = line.chomp.to_s |
|
68 |
if e =~ /^\d+\s+(\w+)\s+([0-9a-f]{40})\s+([0-9-]+)\ |
|
|
68 | if e =~ /^\d+\s+(\w+)\s+([0-9a-f]{40})\s+([0-9-]+)\t(.+)$/ | |
|
69 | 69 | type = $1 |
|
70 | 70 | sha = $2 |
|
71 | 71 | size = $3 |
@@ -165,13 +165,13 module Redmine | |||
|
165 | 165 | parsing_descr = 1 |
|
166 | 166 | changeset[:description] = "" |
|
167 | 167 | elsif (parsing_descr == 1 || parsing_descr == 2) \ |
|
168 |
&& line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\ |
|
|
168 | && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/ | |
|
169 | 169 | parsing_descr = 2 |
|
170 | 170 | fileaction = $1 |
|
171 | 171 | filepath = $2 |
|
172 | 172 | files << {:action => fileaction, :path => filepath} |
|
173 | 173 | elsif (parsing_descr == 1 || parsing_descr == 2) \ |
|
174 |
&& line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\d+\s+(\S+)\ |
|
|
174 | && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\d+\s+(\S+)\t(.+)$/ | |
|
175 | 175 | parsing_descr = 2 |
|
176 | 176 | fileaction = $1 |
|
177 | 177 | filepath = $3 |
|
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 9, 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'} |
@@ -59,6 +59,7 class RepositoriesGitControllerTest < ActionController::TestCase | |||
|
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 | 61 | assert assigns(:entries).detect {|e| e.name == 'filemane with spaces.txt' && e.kind == 'file'} |
|
62 | assert assigns(:entries).detect {|e| e.name == ' filename with a leading space.txt ' && e.kind == 'file'} | |
|
62 | 63 | end |
|
63 | 64 | |
|
64 | 65 | def test_browse_branch |
@@ -13,7 +13,7 class GitAdapterTest < ActiveSupport::TestCase | |||
|
13 | 13 | end |
|
14 | 14 | |
|
15 | 15 | def test_getting_all_revisions |
|
16 |
assert_equal 1 |
|
|
16 | assert_equal 15, @adapter.revisions('',nil,nil,:all => true).length | |
|
17 | 17 | end |
|
18 | 18 | |
|
19 | 19 | def test_getting_certain_revisions |
@@ -24,6 +24,14 class GitAdapterTest < ActiveSupport::TestCase | |||
|
24 | 24 | assert_equal 1, @adapter.revisions("filemane with spaces.txt", nil, nil, :all => true).length |
|
25 | 25 | end |
|
26 | 26 | |
|
27 | def test_getting_revisions_with_leading_and_trailing_spaces_in_filename | |
|
28 | assert_equal " filename with a leading space.txt ", @adapter.revisions(" filename with a leading space.txt ", nil, nil, :all => true)[0].paths[0][:path] | |
|
29 | end | |
|
30 | ||
|
31 | def test_getting_entries_with_leading_and_trailing_spaces_in_filename | |
|
32 | assert_equal " filename with a leading space.txt ", @adapter.entries('', '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c')[3].name | |
|
33 | end | |
|
34 | ||
|
27 | 35 | def test_annotate |
|
28 | 36 | annotate = @adapter.annotate('sources/watchers_controller.rb') |
|
29 | 37 | assert_kind_of Redmine::Scm::Adapters::Annotate, annotate |
@@ -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 15, @repository.changesets.count | |
|
38 | assert_equal 24, @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 12, @repository.changesets.count | |
|
61 | 61 | |
|
62 | 62 | @repository.fetch_changesets |
|
63 |
assert_equal 1 |
|
|
63 | assert_equal 15, @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