X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/8d4d90d445cc0b0032e0f76ab98cac5a5a29df66..dd32f373a6ce0ce9782ecd4f8bf6abf59246113a:/src/phorkie/Repository/Post.php diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index fbfea4b..09cb977 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -151,6 +151,10 @@ class Repository_Post ->setOption('force') ->setOption('message', "$notes") ->execute(); + //update info for dumb git HTTP transport + //the post-update hook should do that IMO, but does not somehow + $vc->getCommand('update-server-info')->execute(); + $bChanged = true; } @@ -228,13 +232,17 @@ class Repository_Post return $prefix . $num; } - public function getType($content) + public function getType($content, $returnError = false) { $tmp = tempnam(sys_get_temp_dir(), 'phorkie-autodetect-'); file_put_contents($tmp, $content); $type = Tool_MIME_Type_PlainDetect::autoDetect($tmp); unlink($tmp); + if ($returnError && $type instanceof \PEAR_Error) { + return $type; + } + return $this->findExtForType($type); }