Skip to content

Commit

Permalink
Merge pull request #788 from camilstaps/fix-391-directory-structure-i…
Browse files Browse the repository at this point in the history
…s-ignored

Fix #391: directory structure is ignored
  • Loading branch information
klaussilveira authored Jun 9, 2018
2 parents eab6bc0 + 51edf30 commit ec6211e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Git/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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() . '/'));
}
}

Expand Down

0 comments on commit ec6211e

Please sign in to comment.