Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
95faf5f5
Commit
95faf5f5
authored
7 years ago
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new registry path class to match repository project
parent
85847988
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
app/models/container_repository.rb
app/models/container_repository.rb
+2
-14
No files found.
app/models/container_repository.rb
View file @
95faf5f5
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment