From: Marius Balteanu Date: Sat, 20 Jul 2024 09:46:16 +0000 (+0000) Subject: Merged r22910, r22924, r22928 and r22929 from trunk to 5.1-stable (#40948). X-Git-Tag: 5.1.4~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e7980d7f4c3574a12b3918910f6de837111afd4b;p=redmine.git Merged r22910, r22924, r22928 and r22929 from trunk to 5.1-stable (#40948). git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22940 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index 9637702ab..b6b3c8336 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -219,7 +219,7 @@ class Repository::Git < Repository :repository => self, :revision => rev.identifier, :scmid => rev.scmid, - :committer => rev.author, + :committer => rev.author.truncate(255), :committed_on => rev.time, :comments => rev.message, :parents => parents diff --git a/test/fixtures/repositories/git_repository.tar.gz b/test/fixtures/repositories/git_repository.tar.gz index 0ea93071f..f31979845 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/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index d20918d5a..181787af4 100644 --- a/test/functional/repositories_git_controller_test.rb +++ b/test/functional/repositories_git_controller_test.rb @@ -28,7 +28,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s REPOSITORY_PATH.tr!('/', "\\") if Redmine::Platform.mswin? PRJ_ID = 3 - NUM_REV = 28 + NUM_REV = 29 def setup super diff --git a/test/integration/repositories_git_test.rb b/test/integration/repositories_git_test.rb index 67c61575c..8a33c356e 100644 --- a/test/integration/repositories_git_test.rb +++ b/test/integration/repositories_git_test.rb @@ -26,7 +26,7 @@ class RepositoriesGitTest < Redmine::IntegrationTest REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s REPOSITORY_PATH.tr!('/', "\\") if Redmine::Platform.mswin? PRJ_ID = 3 - NUM_REV = 28 + NUM_REV = 29 def setup User.current = nil 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 6ea41e75e..b7a95b635 100644 --- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb @@ -102,12 +102,12 @@ class GitAdapterTest < ActiveSupport::TestCase assert_equal false, br_latin_1_path.is_default br_master = brs[4] assert_equal 'master', br_master.to_s - assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', br_master.revision + assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', br_master.revision assert_equal br_master.scmid, br_master.revision assert_equal false, br_master.is_default br_master_20120212 = brs[5] assert_equal 'master-20120212', br_master_20120212.to_s - assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', br_master_20120212.revision + assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', br_master_20120212.revision assert_equal br_master_20120212.scmid, br_master_20120212.revision assert_equal true, br_master_20120212.is_default br_latin_1 = brs[-2] @@ -161,8 +161,8 @@ class GitAdapterTest < ActiveSupport::TestCase @adapter.revisions('', nil, "master", {}) do |rev| revs1 << rev end - assert_equal 15, revs1.length - assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs1[0].identifier + assert_equal 16, revs1.length + assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs1[0].identifier assert_equal '7234cb2750b63f47bff735edc50a1c0a433c2518', revs1[-1].identifier revs2 = [] @@ -170,8 +170,8 @@ class GitAdapterTest < ActiveSupport::TestCase {:reverse => true}) do |rev| revs2 << rev end - assert_equal 15, revs2.length - assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs2[-1].identifier + assert_equal 16, revs2.length + assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs2[-1].identifier assert_equal '7234cb2750b63f47bff735edc50a1c0a433c2518', revs2[0].identifier end @@ -183,14 +183,14 @@ class GitAdapterTest < ActiveSupport::TestCase {:reverse => true}) do |rev| revs1 << rev end - assert_equal 8, revs1.length + assert_equal 9, revs1.length assert_equal 'fba357b886984ee71185ad2065e65fc0417d9b92', revs1[0].identifier assert_equal '7e61ac704deecde634b51e59daa8110435dcb3da', revs1[1].identifier # 4a07fe31b is not a child of 713f49446 assert_equal '4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8', revs1[2].identifier # Merged revision assert_equal '32ae898b720c2f7eec2723d5bdd558b4cb2d3ddf', revs1[3].identifier - assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs1[-1].identifier + assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs1[-1].identifier revs2 = [] @adapter.revisions('', @@ -199,13 +199,13 @@ class GitAdapterTest < ActiveSupport::TestCase {:reverse => true}) do |rev| revs2 << rev end - assert_equal 7, revs2.length + assert_equal 8, revs2.length assert_equal '7e61ac704deecde634b51e59daa8110435dcb3da', revs2[0].identifier # 4a07fe31b is not a child of fba357b8869 assert_equal '4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8', revs2[1].identifier # Merged revision assert_equal '32ae898b720c2f7eec2723d5bdd558b4cb2d3ddf', revs2[2].identifier - assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs2[-1].identifier + assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs2[-1].identifier end def test_revisions_branch_latin_1_path_encoding_all @@ -392,7 +392,7 @@ class GitAdapterTest < ActiveSupport::TestCase {:reverse => true}) do |rev| revs1 << rev end - assert_equal 15, revs1.length + assert_equal 16, revs1.length assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518", revs1[0].identifier assert_nil revs1[0].parents diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index 7f848c043..921628a9d 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -20,7 +20,7 @@ require_relative '../test_helper' class RepositoryGitTest < ActiveSupport::TestCase - fixtures :projects, :repositories, :enabled_modules, :users, :roles + fixtures :projects, :repositories, :enabled_modules, :users, :roles, :changesets include Redmine::I18n @@ -30,7 +30,7 @@ class RepositoryGitTest < ActiveSupport::TestCase REPOSITORY_UTF8_PATH = Rails.root.join('tmp/test/git_utf8_repository').to_s REPOSITORY_UTF8_PATH.tr!('/', "\\") if Redmine::Platform.mswin? - NUM_REV = 28 + NUM_REV = 29 NUM_HEAD = 8 def setup @@ -135,7 +135,7 @@ class RepositoryGitTest < ActiveSupport::TestCase @project.reload assert_equal NUM_REV, @repository.changesets.count - assert_equal 39, @repository.filechanges.count + assert_equal 40, @repository.filechanges.count commit = @repository.changesets.find_by_revision("7234cb2750b63f47bff735edc50a1c0a433c2518") assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518", commit.scmid @@ -161,10 +161,11 @@ class RepositoryGitTest < ActiveSupport::TestCase assert_equal NUM_REV, @repository.changesets.count extra_info_heads = @repository.extra_info["heads"].dup assert_equal NUM_HEAD, extra_info_heads.size - extra_info_heads.delete_if {|x| x == "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c"} + extra_info_heads.delete_if {|x| x == "b1650eac7c505a6dab9f19858afc9ecb481eccc2"} assert_equal NUM_HEAD - 2, extra_info_heads.size del_revs = [ + "b1650eac7c505a6dab9f19858afc9ecb481eccc2", "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c", "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", "4f26664364207fa8b1af9f8722647ab2d4ac5d43", @@ -177,7 +178,7 @@ class RepositoryGitTest < ActiveSupport::TestCase end @project.reload cs1 = @repository.changesets - assert_equal NUM_REV - 6, cs1.count + assert_equal NUM_REV - del_revs.size, cs1.count extra_info_heads << "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8" h = {} h["heads"] = extra_info_heads @@ -189,7 +190,7 @@ class RepositoryGitTest < ActiveSupport::TestCase @project.reload assert_equal NUM_REV, @repository.changesets.count assert_equal NUM_HEAD, @repository.extra_info["heads"].size - assert @repository.extra_info["heads"].index("83ca5fd546063a3c7dc2e568ba3355661a9e2b2c") + assert @repository.extra_info["heads"].index("b1650eac7c505a6dab9f19858afc9ecb481eccc2") end def test_fetch_changesets_history_editing @@ -199,10 +200,11 @@ class RepositoryGitTest < ActiveSupport::TestCase assert_equal NUM_REV, @repository.changesets.count extra_info_heads = @repository.extra_info["heads"].dup assert_equal NUM_HEAD, extra_info_heads.size - extra_info_heads.delete_if {|x| x == "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c"} + extra_info_heads.delete_if {|x| x == "b1650eac7c505a6dab9f19858afc9ecb481eccc2"} assert_equal NUM_HEAD - 2, extra_info_heads.size del_revs = [ + "b1650eac7c505a6dab9f19858afc9ecb481eccc2", "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c", "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", "4f26664364207fa8b1af9f8722647ab2d4ac5d43", @@ -214,7 +216,7 @@ class RepositoryGitTest < ActiveSupport::TestCase rev.destroy if del_revs.detect {|r| r == rev.scmid.to_s} end @project.reload - assert_equal NUM_REV - 6, @repository.changesets.count + assert_equal NUM_REV - del_revs.size, @repository.changesets.count c = Changeset.new(:repository => @repository, :committed_on => Time.now, @@ -223,7 +225,7 @@ class RepositoryGitTest < ActiveSupport::TestCase :comments => 'test') assert c.save @project.reload - assert_equal NUM_REV - 5, @repository.changesets.count + assert_equal NUM_REV - del_revs.size + 1, @repository.changesets.count extra_info_heads << "1234abcd5678" h = {} @@ -237,7 +239,7 @@ class RepositoryGitTest < ActiveSupport::TestCase @repository.fetch_changesets @project.reload - assert_equal NUM_REV - 5, @repository.changesets.count + assert_equal NUM_REV - del_revs.size + 1, @repository.changesets.count h2 = @repository.extra_info["heads"].dup assert_equal h1, h2 end @@ -312,9 +314,10 @@ class RepositoryGitTest < ActiveSupport::TestCase assert_equal 0, @repository.extra_info["db_consistent"]["ordering"] extra_info_heads = @repository.extra_info["heads"].dup - extra_info_heads.delete_if {|x| x == "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c"} + extra_info_heads.delete_if {|x| x == "b1650eac7c505a6dab9f19858afc9ecb481eccc2"} del_revs = [ + "b1650eac7c505a6dab9f19858afc9ecb481eccc2", "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c", "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", "4f26664364207fa8b1af9f8722647ab2d4ac5d43", @@ -327,7 +330,7 @@ class RepositoryGitTest < ActiveSupport::TestCase end @project.reload cs1 = @repository.changesets - assert_equal NUM_REV - 6, cs1.count + assert_equal NUM_REV - del_revs.size, cs1.count assert_equal 0, @repository.extra_info["db_consistent"]["ordering"] extra_info_heads << "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8"