forked from TrueCloudLab/distribution
Revert "removed redundant check"
This reverts commit 0f846853fe
.
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
This commit is contained in:
parent
8e4a8517c5
commit
ad11105052
1 changed files with 8 additions and 0 deletions
|
@ -112,6 +112,14 @@ func (reg *registry) walkRepos(ctx context.Context, root, last string, fn func(r
|
||||||
// walkReposPath walks through all folders in `lookPath`,
|
// walkReposPath walks through all folders in `lookPath`,
|
||||||
// looking for repositories. See walkRepos for more detailed description.
|
// looking for repositories. See walkRepos for more detailed description.
|
||||||
func (reg *registry) walkReposPath(ctx context.Context, root, lookPath, last string, fn func(repoPath string) error) error {
|
func (reg *registry) walkReposPath(ctx context.Context, root, lookPath, last string, fn func(repoPath string) error) error {
|
||||||
|
// ensure that the current path is a dir, otherwise we just return
|
||||||
|
if f, err := reg.blobStore.driver.Stat(ctx, lookPath); err != nil || !f.IsDir() {
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// get children in the current path
|
// get children in the current path
|
||||||
children, err := reg.blobStore.driver.List(ctx, lookPath)
|
children, err := reg.blobStore.driver.List(ctx, lookPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue