Fixed issue 285, weird mkdir() error sometimes on first git push.

master
Loic d'Anterroches 2009-09-21 10:03:33 +02:00
parent 25d7a5a776
commit 157819195b
1 changed files with 6 additions and 2 deletions

View File

@ -91,7 +91,9 @@ class IDF_Plugin_SyncGit_Serve
// the repository on the fly
$p = explode(DIRECTORY_SEPARATOR, $fullpath);
$mpath = implode(DIRECTORY_SEPARATOR, array_slice($p, 0, -1));
mkdir($mpath, 0750, true);
if (!file_exists($mpath)) {
mkdir($mpath, 0750, true);
}
$this->initRepository($fullpath);
$this->setGitExport($relpath, $fullpath);
}
@ -190,7 +192,9 @@ class IDF_Plugin_SyncGit_Serve
*/
public function initRepository($fullpath)
{
mkdir($fullpath, 0750, true);
if (!file_exists($fullpath)) {
mkdir($fullpath, 0750, true);
}
exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').
Pluf::f('git_path', 'git').' --git-dir=%s init', escapeshellarg($fullpath)),
$out, $res);