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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-29 13:14:06 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-29 13:14:06 +0300
commit95faf5f5b7268ea1750f3a764cd0537b3e0d1e25 (patch)
tree2d568dd479d355760f6eb9dd9df03e9643cec839 /app/models/container_repository.rb
parent8584798886a8c7d0077157c29e0dc05087656aaf (diff)
Use new registry path class to match repository project
Diffstat (limited to 'app/models/container_repository.rb')
-rw-r--r--app/models/container_repository.rb16
1 files changed, 2 insertions, 14 deletions
diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb
index c8c56e69269..149d65ddbff 100644
--- a/app/models/container_repository.rb
+++ b/app/models/container_repository.rb
@@ -62,19 +62,7 @@ class ContainerRepository < ActiveRecord::Base
# TODO, we will return a new ContainerRepository object here
#
def self.project_from_path(repository_path)
- return unless repository_path.include?('/')
-
- ##
- # Projects are always located inside a namespace, so we can remove
- # the last node, and see if project with that path exists.
- #
- truncated_path = repository_path.slice(0...repository_path.rindex('/'))
-
- ##
- # We still make it possible to search projects by a full image path
- # in order to maintain backwards compatibility.
- #
- Project.find_by_full_path(truncated_path) ||
- Project.find_by_full_path(repository_path)
+ ContainerRegistry::Path.new(repository_path)
+ .repository_project
end
end