Allow for bare repositories

This commit is contained in:
Daniel Holmes 2013-06-30 18:55:25 +10:00
parent b767da324a
commit 895928422e

View file

@ -31,6 +31,17 @@ class LocalBuild extends Build
$buildPath = substr($buildPath, 0, -1);
$yamlParser = new YamlParser();
if(is_file($reference.'config')) {
//We're probably looing at a bare repository. We'll open the config and check
$gitConfig = parse_ini_file($reference.'config');
if($gitConfig["core"]["bare"]) {
// Looks like we're right. We need to extract the archive!
$guid = uniqid();
$builder->executeCommand('mkdir "/tmp/%s" && git archive master | tar -x -C "/tmp/%s"', $guid, $guid);
$reference = '/tmp/'.$guid;
}
}
if (!is_file($reference . '/phpci.yml')) {
$builder->logFailure('Project does not contain a phpci.yml file.');
return false;