diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-07-08 20:35:16 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-07-08 20:35:16 +0000 |
commit | c1eff66f683174b6ee7ad128bef530f1927f8ea1 (patch) | |
tree | 5e96a2dca6cab171555e9c86719e8a98915b4db9 | |
parent | b2b2c52b78eebd31328d790a08088f4ded033337 (diff) | |
download | redmine-c1eff66f683174b6ee7ad128bef530f1927f8ea1.tar.gz redmine-c1eff66f683174b6ee7ad128bef530f1927f8ea1.zip |
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
-rw-r--r-- | app/models/repository/git.rb | 2 | ||||
-rw-r--r-- | test/fixtures/repositories/git_repository.tar.gz | bin | 21103 -> 24739 bytes | |||
-rw-r--r-- | test/functional/repositories_git_controller_test.rb | 2 | ||||
-rw-r--r-- | test/integration/repositories_git_test.rb | 2 |
4 files changed, 3 insertions, 3 deletions
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 Binary files differindex 0ea93071f..39fae5503 100644 --- a/test/fixtures/repositories/git_repository.tar.gz +++ b/test/fixtures/repositories/git_repository.tar.gz diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index fee41faac..70d795068 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 |