2012-10-01 Christian Weiske <cweiske@cweiske.de>
* Fix bug #27: render .json files
+ * Fix bug #31: forked pastes cannot be remote forked
2012-09-28 Christian Weiske <cweiske@cweiske.de>
throw $e;
}
- foreach (\glob($new->gitDir . '/hooks/*') as $hookfile) {
- \unlink($hookfile);
- }
+ $rs = new Repository_Setup($new);
+ $rs->afterInit();
return $new;
}
->addArgument($repo->workDir)
->execute();
- foreach (glob($repo->gitDir . '/hooks/*') as $hookfile) {
- unlink($hookfile);
- }
-
- touch($repo->gitDir . '/git-daemon-export-ok');
+ $rs = new Repository_Setup($repo);
+ $rs->afterInit();
return $repo;
}
--- /dev/null
+<?php
+namespace phorkie;
+
+class Repository_Setup
+{
+ protected $repo;
+
+ public function __construct(Repository $repo)
+ {
+ $this->repo = $repo;
+ }
+
+ /**
+ * Should be called right after a repository has been created,
+ * either by "git init" or "git clone".
+ * Takes care of removing hook example files and creating
+ * the git daemon export file
+ *
+ * @return void
+ */
+ public function afterInit()
+ {
+ foreach (glob($this->repo->gitDir . '/hooks/*') as $hookfile) {
+ unlink($hookfile);
+ }
+ touch($this->repo->gitDir . '/git-daemon-export-ok');
+ }
+
+}
+
+?>