From: Toshi MARUYAMA Date: Mon, 7 Mar 2011 23:47:25 +0000 (+0000) Subject: scm: git: update test repository for path encoding (#5251). X-Git-Tag: 1.2.0~809 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=daac76f1b642f2b6364812e73d272ebc39bb80ab;p=redmine.git scm: git: update test repository for path encoding (#5251). 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 --- diff --git a/test/fixtures/repositories/git_repository.tar.gz b/test/fixtures/repositories/git_repository.tar.gz index 448f11d2d..a7fb21acf 100644 Binary files a/test/fixtures/repositories/git_repository.tar.gz and b/test/fixtures/repositories/git_repository.tar.gz differ diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb index ba8d3f69c..80148a976 100644 --- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb @@ -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 diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index c6e2d8372..a71c32970 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -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