diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/models/repository.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index ef17e010ba8..d4fd202b966 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -26,6 +26,7 @@ class Repository delegate :ref_name_for_sha, to: :raw_repository delegate :bundle_to_disk, to: :raw_repository + delegate :lfs_enabled?, to: :container CreateTreeError = Class.new(StandardError) AmbiguousRefError = Class.new(StandardError) @@ -853,16 +854,16 @@ class Repository def merge(user, source_sha, merge_request, message) with_cache_hooks do raw_repository.merge(user, source_sha, merge_request.target_branch, message) do |commit_id| - merge_request.update(in_progress_merge_commit_sha: commit_id) + merge_request.update_and_mark_in_progress_merge_commit_sha(commit_id) nil # Return value does not matter. end end end - def merge_to_ref(user, source_sha, merge_request, target_ref, message, first_parent_ref) + def merge_to_ref(user, source_sha, merge_request, target_ref, message, first_parent_ref, allow_conflicts = false) branch = merge_request.target_branch - raw.merge_to_ref(user, source_sha, branch, target_ref, message, first_parent_ref) + raw.merge_to_ref(user, source_sha, branch, target_ref, message, first_parent_ref, allow_conflicts) end def delete_refs(*ref_names) @@ -873,7 +874,7 @@ class Repository their_commit_id = commit(source)&.id raise 'Invalid merge source' if their_commit_id.nil? - merge_request&.update(in_progress_merge_commit_sha: their_commit_id) + merge_request&.update_and_mark_in_progress_merge_commit_sha(their_commit_id) with_cache_hooks { raw.ff_merge(user, their_commit_id, target_branch) } end @@ -1142,21 +1143,10 @@ class Repository end def project - if repo_type.snippet? - container.project - elsif container.is_a?(Project) - container - end - end - - # TODO: pass this in directly to `Blob` rather than delegating it to here - # - # https://gitlab.com/gitlab-org/gitlab/-/issues/201886 - def lfs_enabled? if container.is_a?(Project) - container.lfs_enabled? + container else - false # LFS is not supported for snippet or group repositories + container.try(:project) end end |