Commit 77757b82 authored by Tomáš Pospíšil's avatar Tomáš Pospíšil
Browse files

fix gitparser for new project

parent 437c87f5
......@@ -23,16 +23,19 @@ final class GitParser
public function getBranches(): array
{
$dir = Dumper::getDirectory();
$heads = $dir . '/.git/refs/heads';
if (!is_dir($heads)) {
return [];
}
$files = scandir($heads);
$files = scandir($dir . '/.git/refs/heads');
$branches = [];
if ($dir && is_array($files)) {
foreach ($files as $file) {
if ('.' !== $file && '..' !== $file) {
if ($file !== $this->getBranchName()) {
$branches[] = $file;
}
if ('.' !== $file && '..' !== $file && $file !== $this->getBranchName()) {
$branches[] = $file;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment