Fixed to correctly update the git daemon export flag as needed.

This commit is contained in:
Loic d'Anterroches
2009-01-20 17:31:55 +01:00
parent 8cfc5ec026
commit 5d3ce34c4b
3 changed files with 20 additions and 0 deletions

View File

@@ -231,6 +231,9 @@ class IDF_Plugin_SyncGit_Serve
*/
public function gitExportDeny($fullpath)
{
if (!file_exists($fullpath)) {
return; // Not created yet.
}
@unlink($fullpath.DIRECTORY_SEPARATOR.'git-daemon-export-ok');
if (file_exists($fullpath.DIRECTORY_SEPARATOR.'git-daemon-export-ok')) {
throw new Exception('Cannot remove git-daemon-export-ok file.');
@@ -245,6 +248,9 @@ class IDF_Plugin_SyncGit_Serve
*/
public function gitExportAllow($fullpath)
{
if (!file_exists($fullpath)) {
return; // Not created yet.
}
touch($fullpath.DIRECTORY_SEPARATOR.'git-daemon-export-ok');
if (!file_exists($fullpath.DIRECTORY_SEPARATOR.'git-daemon-export-ok')) {
throw new Exception('Cannot create git-daemon-export-ok file.');