1
0
Fork 0

performance: Do not create a local cache repo for local repos (#11001)

pull/11004/head
EXTEON 2022-08-17 16:11:34 +03:00 committed by GitHub
parent c4d8061ebf
commit c529087631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
*/ */
protected function doDownload(PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null): PromiseInterface protected function doDownload(PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null): PromiseInterface
{ {
// Do not create an extra local cache when repository is already local
if (Filesystem::isLocalPath($url)) {
return \React\Promise\resolve(null);
}
GitUtil::cleanEnv(); GitUtil::cleanEnv();
$cachePath = $this->config->get('cache-vcs-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', $url).'/'; $cachePath = $this->config->get('cache-vcs-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', $url).'/';