X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/808a3a5857c77ef99605fdfdde9b31b5c02e22c6..HEAD:/src/phorkie/Repository/Post.php diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index 7a373aa..ce9e52c 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -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