From c5290876318942e418e6dbd1b0680be59df954e8 Mon Sep 17 00:00:00 2001 From: EXTEON Date: Wed, 17 Aug 2022 16:11:34 +0300 Subject: [PATCH] performance: Do not create a local cache repo for local repos (#11001) --- src/Composer/Downloader/GitDownloader.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index d11a37958..3ba921868 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -60,6 +60,11 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface */ 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(); $cachePath = $this->config->get('cache-vcs-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', $url).'/';