Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/gitaly/commit.rb')
-rw-r--r--spec/factories/gitaly/commit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/factories/gitaly/commit.rb b/spec/factories/gitaly/commit.rb
index 4e8220e449a..ecf3e4e065e 100644
--- a/spec/factories/gitaly/commit.rb
+++ b/spec/factories/gitaly/commit.rb
@@ -16,5 +16,15 @@ FactoryBot.define do
body { subject + "\nMy body" }
author { association(:gitaly_commit_author) }
committer { association(:gitaly_commit_author) }
+
+ trailers do
+ trailers = body.lines.keep_if { |l| l =~ /.*: / }.map do |l|
+ key, value = *l.split(":").map(&:strip)
+
+ Gitaly::CommitTrailer.new(key: key, value: value)
+ end
+
+ Google::Protobuf::RepeatedField.new(:message, Gitaly::CommitTrailer, trailers)
+ end
end
end