OSDN Git Service

scm: git: update test repository for path encoding (#5251).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 7 Mar 2011 23:47:25 +0000 (23:47 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 7 Mar 2011 23:47:25 +0000 (23:47 +0000)
Mercurial and Git treats file names as byte string.
This git test repository contains Latin-1 encoding path.
Be careful on non Latin-1(CP1252) Windows.

Please see r4996 comment.

I removed a revision including "copied file" from r5026 test repository.
Mercurial supports "copy", but Git does not support.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5033 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/fixtures/repositories/git_repository.tar.gz
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
test/unit/repository_git_test.rb

index 448f11d..a7fb21a 100644 (file)
Binary files a/test/fixtures/repositories/git_repository.tar.gz and b/test/fixtures/repositories/git_repository.tar.gz differ
index ba8d3f6..80148a9 100644 (file)
@@ -28,11 +28,16 @@ begin
       end
 
       def test_branches
-        assert_equal @adapter.branches, ['master', 'test-latin-1', 'test_branch']
+        assert_equal  [
+              'latin-1-path-encoding',
+              'master',
+              'test-latin-1',
+              'test_branch',
+            ], @adapter.branches
       end
 
       def test_getting_all_revisions
-        assert_equal 16, @adapter.revisions('',nil,nil,:all => true).length
+        assert_equal 20, @adapter.revisions('',nil,nil,:all => true).length
       end
 
       def test_getting_certain_revisions
index c6e2d83..a71c329 100644 (file)
@@ -38,8 +38,8 @@ class RepositoryGitTest < ActiveSupport::TestCase
       @repository.fetch_changesets
       @repository.reload
 
-      assert_equal 16, @repository.changesets.count
-      assert_equal 25, @repository.changes.count
+      assert_equal 20, @repository.changesets.count
+      assert_equal 30, @repository.changes.count
 
       commit = @repository.changesets.find(:first, :order => 'committed_on ASC')
       assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments
@@ -59,7 +59,7 @@ class RepositoryGitTest < ActiveSupport::TestCase
     def test_fetch_changesets_incremental
       @repository.fetch_changesets
       # Remove the 3 latest changesets
-      @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy)
+      @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 7).each(&:destroy)
       @repository.reload
       cs1 = @repository.changesets
       assert_equal 13, cs1.count
@@ -74,7 +74,7 @@ class RepositoryGitTest < ActiveSupport::TestCase
       assert_equal rev_a_committed_on, latest_rev.committed_on
 
       @repository.fetch_changesets
-      assert_equal 16, @repository.changesets.count
+      assert_equal 20, @repository.changesets.count
     end
 
     def test_find_changeset_by_name