Skip to content

Commit

Permalink
performance: Do not create a local cache repo for local repos (compos…
Browse files Browse the repository at this point in the history
  • Loading branch information
exteon authored and emahorvat52 committed Jan 18, 2023
1 parent d0bf975 commit b4d9103
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 b4d9103

Please sign in to comment.