]> source.dussan.org Git - redmine.git/commitdiff
Merged r22910, r22924, r22928 and r22929 from trunk to 5.0-stable (#40948).
authorMarius Balteanu <marius.balteanu@zitec.com>
Sat, 20 Jul 2024 09:47:17 +0000 (09:47 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sat, 20 Jul 2024 09:47:17 +0000 (09:47 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22941 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/git.rb
test/fixtures/repositories/git_repository.tar.gz
test/functional/repositories_git_controller_test.rb
test/integration/repositories_git_test.rb
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
test/unit/repository_git_test.rb

index 0e02ddb25990ce0370760963d60e600f0a3246b6..dec354d4e9613b4cce8ff7242fa53334218c8bf9 100644 (file)
@@ -225,7 +225,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
index 0ea93071f1518062464dbaebc4d7f94f09557e99..f31979845863f0c45fb86fee3517bbe896554901 100644 (file)
Binary files a/test/fixtures/repositories/git_repository.tar.gz and b/test/fixtures/repositories/git_repository.tar.gz differ
index 3322fbd55281746f313f326aaca4edb84fa8b9e4..b4f2c3ab4659a2cf94c91d6dca7f857a15e60bbf 100644 (file)
@@ -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
index 909653f927dc05e2e5bae21cb46b064dfbec09a5..b1a899490f799e1a2b63aef8fdb05aab0dc4456b 100644 (file)
@@ -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
index b810055873096e67a167ae4d4735b0e6b8ff58f2..b7a81ba0d7a72a9d6f63afdd15c38fddb888d20f 100644 (file)
@@ -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
index 3f033a09d096f66298b24ed7bb9dc7c3be59fc6c..a438e1a55ccf12f6079807f514e61d07efc043c1 100644 (file)
@@ -20,7 +20,7 @@
 require File.expand_path('../../test_helper', __FILE__)
 
 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"