Update jQuery from 1.12.4 to 3.7.1
[phorkie.git] / src / phorkie / Repository / Post.php
index 7a373aaf9005e65343c831700db81d2ef327403f..ce9e52cea8fd9397410026497740e204d87e3a44 100644 (file)
@@ -13,6 +13,12 @@ class Repository_Post
      */
     public $newfileName;
 
+    /**
+     * List of files that have been renamed.
+     *
+     * @var array
+     */
+    public $renameMap = array();
 
 
     public function __construct(Repository $repo = null)
@@ -48,6 +54,9 @@ class Repository_Post
             $bChanged = true;
         }
 
+        $this->renameMap   = array();
+        $this->newfileName = null;
+
         foreach ($postData['files'] as $num => $arFile) {
             $bUpload = false;
             if ($_FILES['files']['error'][$num]['upload'] == 0) {
@@ -102,6 +111,7 @@ class Repository_Post
                         ->addArgument($name)
                         ->execute();
                     $bCommit = true;
+                    $this->renameMap[$originalName] = $name;
                 } else {
                     $name = $originalName;
                 }
@@ -157,13 +167,20 @@ class Repository_Post
                     'author',
                     $sessionData['name'] . ' <' . $sessionData['email'] . '>'
                 )
+                ->setEnvVar('GIT_AUTHOR_NAME', $sessionData['name'])
+                ->setEnvVar('GIT_AUTHOR_EMAIL', $sessionData['email'])
+                ->setEnvVar('GIT_COMMITTER_NAME', $sessionData['name'])
+                ->setEnvVar('GIT_COMMITTER_EMAIL', $sessionData['email'])
                 ->execute();
             //FIXME: git needs ref BEFORE add
             //quick hack until http://pear.php.net/bugs/bug.php?id=19605 is fixed
-            //also waiting for https://pear.php.net/bugs/bug.php?id=19623
             $vc->getCommand('notes --ref=identity add')
                 ->setOption('force')
                 ->setOption('message', "$notes")
+                ->setEnvVar('GIT_AUTHOR_NAME', $sessionData['name'])
+                ->setEnvVar('GIT_AUTHOR_EMAIL', $sessionData['email'])
+                ->setEnvVar('GIT_COMMITTER_NAME', $sessionData['name'])
+                ->setEnvVar('GIT_COMMITTER_EMAIL', $sessionData['email'])
                 ->execute();
             //update info for dumb git HTTP transport
             //the post-update hook should do that IMO, but does not somehow