getRequest(); $repository = $drequest->getRepository(); $path = $drequest->getPath(); $commit = $drequest->getCommit(); $local_path = $repository->getDetail('local-path'); list($stdout) = execx( '(cd %s && git branch --verbose --no-abbrev)', $local_path); $branches = array(); $lines = array_filter(explode("\n", $stdout)); foreach ($lines as $line) { $matches = null; if (!preg_match('/^[ *] (\S+)\s+([a-z0-9]{40}) /', $line, $matches)) { throw new Exception("Failed to parse {$line}!"); } $branch = new DiffusionBranchInformation(); $branch->setName($matches[1]); $branch->setHeadCommitIdentifier($matches[2]); $branches[] = $branch; } return $branches; } }