Revert "Fixed bad owner/user config, causing pastes to fail with 'Please tell me...
[phorkie.git] / src / phorkie / Repository / Setup.php
index e26338bf9a7656065f2e9696e445ab1b6347bd04..43a85009acd8b956fad5a2fe19a8c3845883b783 100644 (file)
@@ -24,6 +24,30 @@ class Repository_Setup
             unlink($hookfile);
         }
         touch($this->repo->gitDir . '/git-daemon-export-ok');
+
+        $vc = $this->repo->getVc();
+
+        file_put_contents(
+            $this->repo->gitDir . '/hooks/post-update',
+            <<<CDE
+#!/bin/sh
+# Hook script to prepare a packed repository for use over dumb transports.
+
+exec git update-server-info
+
+CDE
+        );
+        chmod($this->repo->gitDir . '/hooks/post-update', 0755);
+
+        //keep track of owner
+        $vc->getCommand('config')
+            ->addArgument('owner.name')
+            ->addArgument($_SESSION['name'])
+            ->execute();
+        $vc->getCommand('config')
+            ->addArgument('owner.email')
+            ->addArgument($_SESSION['email'])
+            ->execute();
     }
 
 }