diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-05-03 15:55:14 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-05-07 12:59:51 +0300 |
commit | 9a13059332a0c81b3a953f57bb9e40346eba951d (patch) | |
tree | 8f2806ec52b77cd212a19f9756c837606d988c62 /app/models/repository.rb | |
parent | 2d84de9ec90b87ee4e1e10ce1a4a9d00b07c39e7 (diff) |
Backports every CE related change from ee-5484 to CE
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 6831305fb93..2a0802482f5 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -861,6 +861,20 @@ class Repository gitlab_shell.fetch_remote(raw_repository, remote, ssh_auth: ssh_auth, forced: forced, no_tags: no_tags, prune: prune) end + def async_remove_remote(remote_name) + return unless remote_name + + job_id = RepositoryRemoveRemoteWorker.perform_async(project.id, remote_name) + + if job_id + Rails.logger.info("Remove remote job scheduled for #{project.id} with remote name: #{remote_name} job ID #{job_id}.") + else + Rails.logger.info("Remove remote job failed to create for #{project.id} with remote name #{remote_name}.") + end + + job_id + end + def fetch_source_branch!(source_repository, source_branch, local_ref) raw_repository.fetch_source_branch!(source_repository.raw_repository, source_branch, local_ref) end |