summaryrefslogtreecommitdiff
path: root/app/models/repository.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb27
1 files changed, 1 insertions, 26 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index a77aaf02e06..1b7663c2973 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -939,32 +939,7 @@ class Repository
end
def fetch_as_mirror(url, forced: false, refmap: :all_refs, remote_name: nil, prune: true)
- return fetch_remote(remote_name, url: url, refmap: refmap, forced: forced, prune: prune) if Feature.enabled?(:fetch_remote_params, project, default_enabled: :yaml)
-
- unless remote_name
- remote_name = "tmp-#{SecureRandom.hex}"
- tmp_remote_name = true
- end
-
- add_remote(remote_name, url, mirror_refmap: refmap)
- fetch_remote(remote_name, forced: forced, prune: prune)
- ensure
- async_remove_remote(remote_name) if tmp_remote_name
- end
-
- def async_remove_remote(remote_name)
- return unless remote_name
- return unless project
-
- job_id = RepositoryRemoveRemoteWorker.perform_async(project.id, remote_name)
-
- if job_id
- Gitlab::AppLogger.info("Remove remote job scheduled for #{project.id} with remote name: #{remote_name} job ID #{job_id}.")
- else
- Gitlab::AppLogger.info("Remove remote job failed to create for #{project.id} with remote name #{remote_name}.")
- end
-
- job_id
+ fetch_remote(remote_name, url: url, refmap: refmap, forced: forced, prune: prune)
end
def fetch_source_branch!(source_repository, source_branch, local_ref)