performance: Do not create a local cache repo for local repos (#11001)
parent
c4d8061ebf
commit
c529087631
|
@ -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).'/';
|
||||||
|
|
Loading…
Reference in New Issue