Truncate git authors to 255 characters (#40948).

The committer column in the database allows max 255 characters. With longer authors, this would result in a schema violation. By manually truncating the author field, we can avoid this.

Patch by Holger Just (@hjust). 



git-svn-id: https://svn.redmine.org/redmine/trunk@22910 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2024-07-08 20:35:16 +00:00
parent b2b2c52b78
commit c1eff66f68
4 changed files with 3 additions and 3 deletions

View File

@@ -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

Binary file not shown.

View 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

View 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