Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-19 06:21:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-19 06:21:36 +0300
commiteba7329faa534bc0ea9332e3278f2a74f61a79dc (patch)
tree39b4d3d4b8d77ebb6766e689d8b9210f0ea643d1 /app/models
parentf3b2c536778dcd0981134c702d97c6e4047b64d4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/container_repository.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb
index 6bcfd23e69c..4df92235f50 100644
--- a/app/models/container_repository.rb
+++ b/app/models/container_repository.rb
@@ -618,12 +618,11 @@ class ContainerRepository < ApplicationRecord
self.new(project: path.repository_project, name: path.repository_name)
end
- def self.find_or_create_from_path(path)
- repository = safe_find_or_create_by(
- project: path.repository_project,
+ def self.find_or_create_from_path!(path)
+ ContainerRepository.upsert({
+ project_id: path.repository_project.id,
name: path.repository_name
- )
- return repository if repository.persisted?
+ }, unique_by: %i[project_id name])
find_by_path!(path)
end