Fixed transient error when the git cron job creates the repository before the first push.

This commit is contained in:
Loic d'Anterroches 2009-10-09 10:35:13 +02:00
parent 58ab16432c
commit 8d32905913

View File

@ -213,7 +213,7 @@ class IDF_Plugin_SyncGit_Serve
{ {
$sql = new Pluf_SQL('shortname=%s', array($relpath)); $sql = new Pluf_SQL('shortname=%s', array($relpath));
$projects = Pluf::factory('IDF_Project')->getList(array('filter'=>$sql->gen())); $projects = Pluf::factory('IDF_Project')->getList(array('filter'=>$sql->gen()));
if ($projects->count() != 1) { if ($projects->count() != 1 and file_exists($fullpath)) {
return $this->gitExportDeny($fullpath); return $this->gitExportDeny($fullpath);
} }
$project = $projects[0]; $project = $projects[0];
@ -221,7 +221,8 @@ class IDF_Plugin_SyncGit_Serve
$conf->setProject($project); $conf->setProject($project);
$scm = $conf->getVal('scm', 'git'); $scm = $conf->getVal('scm', 'git');
if ($scm == 'git' and !file_exists($fullpath)) { if ($scm == 'git' and !file_exists($fullpath)) {
$this->initRepository($fullpath); // No repository yet, just skip
return false;
} }
if ($scm != 'git' or $project->private) { if ($scm != 'git' or $project->private) {
return $this->gitExportDeny($fullpath); return $this->gitExportDeny($fullpath);