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 'app/graphql/mutations/commits/create.rb')
-rw-r--r--app/graphql/mutations/commits/create.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/graphql/mutations/commits/create.rb b/app/graphql/mutations/commits/create.rb
index 2e06e1ea0c4..f432f679909 100644
--- a/app/graphql/mutations/commits/create.rb
+++ b/app/graphql/mutations/commits/create.rb
@@ -44,6 +44,11 @@ module Mutations
null: true,
description: 'The commit after mutation.'
+ field :content,
+ [GraphQL::STRING_TYPE],
+ null: true,
+ description: 'Contents of the commit.'
+
authorize :push_code
def resolve(project_path:, branch:, message:, actions:, **args)
@@ -59,6 +64,7 @@ module Mutations
result = ::Files::MultiService.new(project, current_user, attributes).execute
{
+ content: actions.pluck(:content), # rubocop:disable CodeReuse/ActiveRecord because actions is an Array, not a Relation
commit: (project.repository.commit(result[:result]) if result[:status] == :success),
commit_pipeline_path: UrlHelpers.new.graphql_etag_pipeline_sha_path(result[:result]),
errors: Array.wrap(result[:message])