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:
authorSean McGivern <sean@mcgivern.me.uk>2018-11-07 18:11:30 +0300
committerSean McGivern <sean@mcgivern.me.uk>2018-11-07 18:11:30 +0300
commit6d8810a64f944ff96af54e5c759f866bb68a7453 (patch)
tree8a7f19772e7f38c498cba6b73ca43b5e911705b3 /app/models
parentf323d6148b7b71609cbd32ab9db4724fc108729d (diff)
parent28cbb2acfe413148ff23b8ed4b3293e09ab376f5 (diff)
Merge branch 'fj-41213-api-update-submodule-commit' into 'master'
Add endpoint to update a git submodule reference Closes #41213 See merge request gitlab-org/gitlab-ce!20949
Diffstat (limited to 'app/models')
-rw-r--r--app/models/repository.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index ee5579329a8..6e179f61a7b 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -1014,6 +1014,18 @@ class Repository
message: merge_request.title)
end
+ def update_submodule(user, submodule, commit_sha, message:, branch:)
+ with_cache_hooks do
+ raw.update_submodule(
+ user: user,
+ submodule: submodule,
+ commit_sha: commit_sha,
+ branch: branch,
+ message: message
+ )
+ end
+ end
+
def blob_data_at(sha, path)
blob = blob_at(sha, path)
return unless blob