mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
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:
@@ -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
|
||||
|
||||
BIN
test/fixtures/repositories/git_repository.tar.gz
vendored
BIN
test/fixtures/repositories/git_repository.tar.gz
vendored
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user