Skip to content

Commit

Permalink
performance: Do not create a local cache repo for local repos (#11001)
Browse files Browse the repository at this point in the history
  • Loading branch information
exteon committed Aug 17, 2022
1 parent c4d8061 commit c529087
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Composer/Downloader/GitDownloader.php
Expand Up @@ -60,6 +60,11 @@ public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $p
*/
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).'/';
Expand Down

0 comments on commit c529087

Please sign in to comment.