summaryrefslogtreecommitdiff
path: root/lib/api/remote_mirrors.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-09 12:07:45 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-09 12:07:45 +0000
commitac1dca43baa7b3b1ac7d60d89ad60fdeefed0b80 (patch)
tree33aa23ddf7f18ddbfba3d006041c460de88583b7 /lib/api/remote_mirrors.rb
parentf4186a753b86625a83e8499af14b5badd63a2ac2 (diff)
downloadgitlab-ce-ac1dca43baa7b3b1ac7d60d89ad60fdeefed0b80.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/remote_mirrors.rb')
-rw-r--r--lib/api/remote_mirrors.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/api/remote_mirrors.rb b/lib/api/remote_mirrors.rb
index bdaec67108d..cb8383ff08a 100644
--- a/lib/api/remote_mirrors.rb
+++ b/lib/api/remote_mirrors.rb
@@ -33,9 +33,11 @@ module API
requires :url, type: String, desc: 'The URL for a remote mirror'
optional :enabled, type: Boolean, desc: 'Determines if the mirror is enabled'
optional :only_protected_branches, type: Boolean, desc: 'Determines if only protected branches are mirrored'
+ optional :keep_divergent_refs, type: Boolean, desc: 'Determines if divergent refs are kept on the target'
end
post ':id/remote_mirrors' do
create_params = declared_params(include_missing: false)
+ create_params.delete(:keep_divergent_refs) unless ::Feature.enabled?(:keep_divergent_refs, user_project)
new_mirror = user_project.remote_mirrors.create(create_params)
@@ -53,12 +55,15 @@ module API
requires :mirror_id, type: String, desc: 'The ID of a remote mirror'
optional :enabled, type: Boolean, desc: 'Determines if the mirror is enabled'
optional :only_protected_branches, type: Boolean, desc: 'Determines if only protected branches are mirrored'
+ optional :keep_divergent_refs, type: Boolean, desc: 'Determines if divergent refs are kept on the target'
end
put ':id/remote_mirrors/:mirror_id' do
mirror = user_project.remote_mirrors.find(params[:mirror_id])
mirror_params = declared_params(include_missing: false)
mirror_params[:id] = mirror_params.delete(:mirror_id)
+ mirror_params.delete(:keep_divergent_refs) unless ::Feature.enabled?(:keep_divergent_refs, user_project)
+
update_params = { remote_mirrors_attributes: mirror_params }
result = ::Projects::UpdateService