diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/models/repository.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index a77aaf02e06..0164d6fed93 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -168,8 +168,8 @@ class Repository end # Returns a list of commits that are not present in any reference - def new_commits(newrev) - commits = raw.new_commits(newrev) + def new_commits(newrev, allow_quarantine: false) + commits = raw.new_commits(newrev, allow_quarantine: allow_quarantine) ::Commit.decorate(commits, container) end @@ -502,8 +502,8 @@ class Repository end end - def blob_at(sha, path) - Blob.decorate(raw_repository.blob_at(sha, path), container) + def blob_at(sha, path, limit: Gitlab::Git::Blob::MAX_DATA_DISPLAY_SIZE) + Blob.decorate(raw_repository.blob_at(sha, path, limit: limit), container) rescue Gitlab::Git::Repository::NoRepository nil end @@ -656,7 +656,7 @@ class Repository end end - def tree(sha = :head, path = nil, recursive: false) + def tree(sha = :head, path = nil, recursive: false, pagination_params: nil) if sha == :head return unless head_commit @@ -667,7 +667,7 @@ class Repository end end - Tree.new(self, sha, path, recursive: recursive) + Tree.new(self, sha, path, recursive: recursive, pagination_params: pagination_params) end def blob_at_branch(branch_name, path) @@ -938,33 +938,8 @@ class Repository end 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 + def fetch_as_mirror(url, forced: false, refmap: :all_refs, prune: true, http_authorization_header: "") + fetch_remote(url, refmap: refmap, forced: forced, prune: prune, http_authorization_header: http_authorization_header) end def fetch_source_branch!(source_repository, source_branch, local_ref) |