}
$bNew = false;
+ $bDelete = false;
if (!isset($orignalName) || $orignalName == '') {
//new file
$bNew = true;
//unknown file
//FIXME: Show error message
continue;
+ } else if (isset($arFile['delete']) && $arFile['delete'] == 1) {
+ $bDelete = true;
} else if ($orignalName != $name) {
//FIXME: what to do with overwrites?
$vc->getCommand('mv')
}
$file = $this->repo->getFileByName($name, false);
- if ($bNew || $file->getContent() != $arFile['content']) {
+ if ($bDelete) {
+ $command = $vc->getCommand('rm')
+ ->addArgument($file->getFilename())
+ ->execute();
+ $bChanged = true;
+ } else if ($bNew || $file->getContent() != $arFile['content']) {
file_put_contents($file->getPath(), $arFile['content']);
$command = $vc->getCommand('add')
->addArgument($file->getFilename())
$repo = $rs->createNew();
$vc = $repo->getVc();
$vc->initRepository();
+
foreach (glob($repo->repoDir . '/.git/hooks/*') as $hookfile) {
unlink($hookfile);
}
+
+ touch($repo->repoDir . '/.git/git-daemon-export-ok');
+
return $repo;
}