From 6b32413e69dbb982b58957931a38dce5f4b1a00c Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Wed, 21 Jan 2009 20:05:03 +0100 Subject: [PATCH] Automatically create the git repository during the cron run. --- src/IDF/Plugin/SyncGit/Serve.php | 3 +++ src/IDF/relations.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/IDF/Plugin/SyncGit/Serve.php b/src/IDF/Plugin/SyncGit/Serve.php index bbdafbc..67f2d8e 100644 --- a/src/IDF/Plugin/SyncGit/Serve.php +++ b/src/IDF/Plugin/SyncGit/Serve.php @@ -215,6 +215,9 @@ class IDF_Plugin_SyncGit_Serve $conf = new IDF_Conf(); $conf->setProject($project); $scm = $conf->getVal('scm', 'git'); + if ($scm == 'git' and !file_exists($fullpath)) { + $this->initRepository($fullpath); + } if ($scm != 'git' or $project->private) { return $this->gitExportDeny($fullpath); } diff --git a/src/IDF/relations.php b/src/IDF/relations.php index f18b35f..4ec2a89 100644 --- a/src/IDF/relations.php +++ b/src/IDF/relations.php @@ -67,5 +67,7 @@ Pluf_Signal::connect('IDF_Project::membershipsUpdated', array('IDF_Plugin_SyncGit', 'entry')); Pluf_Signal::connect('IDF_Key::postSave', array('IDF_Plugin_SyncGit', 'entry')); +Pluf_Signal::connect('IDF_Project::created', + array('IDF_Plugin_SyncGit', 'entry')); return $m;