From 8d3290591327e2c4b8f24837c93b720c50555edf Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Fri, 9 Oct 2009 10:35:13 +0200 Subject: [PATCH] Fixed transient error when the git cron job creates the repository before the first push. --- src/IDF/Plugin/SyncGit/Serve.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/IDF/Plugin/SyncGit/Serve.php b/src/IDF/Plugin/SyncGit/Serve.php index d22448f..a05b9f9 100644 --- a/src/IDF/Plugin/SyncGit/Serve.php +++ b/src/IDF/Plugin/SyncGit/Serve.php @@ -213,7 +213,7 @@ class IDF_Plugin_SyncGit_Serve { $sql = new Pluf_SQL('shortname=%s', array($relpath)); $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); } $project = $projects[0]; @@ -221,7 +221,8 @@ class IDF_Plugin_SyncGit_Serve $conf->setProject($project); $scm = $conf->getVal('scm', 'git'); if ($scm == 'git' and !file_exists($fullpath)) { - $this->initRepository($fullpath); + // No repository yet, just skip + return false; } if ($scm != 'git' or $project->private) { return $this->gitExportDeny($fullpath);