From 51edf30f69464e2998bab5b3aaa6a6fab49fe023 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 8 Jun 2018 17:22:10 +0200 Subject: [PATCH] Fix #391: directory structure is ignored --- src/Git/Client.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Git/Client.php b/src/Git/Client.php index d6c6d1f8..f2a22d49 100644 --- a/src/Git/Client.php +++ b/src/Git/Client.php @@ -157,7 +157,7 @@ protected function setProjects($projects) return $this; } - private function recurseDirectory($path, $topLevel = true) + private function recurseDirectory($path, $appendPath = '') { $dir = new \DirectoryIterator($path); @@ -209,11 +209,7 @@ private function recurseDirectory($path, $topLevel = true) $description = null; } - if (!$topLevel) { - $repoName = $file->getPathInfo()->getFilename() . '/' . $file->getFilename(); - } else { - $repoName = $file->getFilename(); - } + $repoName = $appendPath . $file->getFilename(); if (is_array($this->getProjects()) && !in_array($repoName, $this->getProjects())) { continue; @@ -227,7 +223,7 @@ private function recurseDirectory($path, $topLevel = true) continue; } - $repositories = array_merge($repositories, $this->recurseDirectory($file->getPathname(), false)); + $repositories = array_merge($repositories, $this->recurseDirectory($file->getPathname(), $appendPath . $file->getFilename() . '/')); } }