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() . '/')); } }