Make it clear that a package is cloned from source, fixes #5489
parent
685ff8699b
commit
2f3db8c397
|
@ -49,17 +49,19 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
|
||||||
|
|
||||||
// --dissociate option is only available since git 2.3.0-rc0
|
// --dissociate option is only available since git 2.3.0-rc0
|
||||||
$gitVersion = $this->gitUtil->getVersion();
|
$gitVersion = $this->gitUtil->getVersion();
|
||||||
|
$msg = " Cloning ".$ref;
|
||||||
if ($gitVersion && version_compare($gitVersion, '2.3.0-rc0', '>=')) {
|
if ($gitVersion && version_compare($gitVersion, '2.3.0-rc0', '>=')) {
|
||||||
$this->io->writeError(sprintf(' Cloning to cache at %s', ProcessExecutor::escape($cachePath)), true, IOInterface::DEBUG);
|
$this->io->writeError(sprintf(' Cloning to cache at %s', ProcessExecutor::escape($cachePath)), true, IOInterface::DEBUG);
|
||||||
try {
|
try {
|
||||||
$this->gitUtil->syncMirror($url, $cachePath);
|
$this->gitUtil->syncMirror($url, $cachePath);
|
||||||
if (is_dir($cachePath)) {
|
if (is_dir($cachePath)) {
|
||||||
$cacheOptions = sprintf('--dissociate --reference %s ', ProcessExecutor::escape($cachePath));
|
$cacheOptions = sprintf('--dissociate --reference %s ', ProcessExecutor::escape($cachePath));
|
||||||
|
$msg = " Cloning ".$ref.' from cache';
|
||||||
}
|
}
|
||||||
} catch (\RuntimeException $e) {}
|
} catch (\RuntimeException $e) {}
|
||||||
}
|
}
|
||||||
$command = 'git clone --no-checkout %s %s '.$cacheOptions.'&& cd '.$flag.'%2$s && git remote add composer %1$s && git fetch composer';
|
$command = 'git clone --no-checkout %s %s '.$cacheOptions.'&& cd '.$flag.'%2$s && git remote add composer %1$s && git fetch composer';
|
||||||
$this->io->writeError(" Cloning ".$ref);
|
$this->io->writeError($msg);
|
||||||
|
|
||||||
$commandCallable = function ($url) use ($ref, $path, $command) {
|
$commandCallable = function ($url) use ($ref, $path, $command) {
|
||||||
return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($ref));
|
return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($ref));
|
||||||
|
|
Loading…
Reference in New Issue