GitDownloader: add option for single use git clone to avoid --dissociate when cloning from local copy (#10288)
parent
0f5f0fb9e1
commit
63b5cbe000
|
@ -92,8 +92,15 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
|
||||||
|
|
||||||
if (!empty($this->cachedPackages[$package->getId()][$ref])) {
|
if (!empty($this->cachedPackages[$package->getId()][$ref])) {
|
||||||
$msg = "Cloning ".$this->getShortHash($ref).' from cache';
|
$msg = "Cloning ".$this->getShortHash($ref).' from cache';
|
||||||
|
|
||||||
|
$cloneFlags = '--dissociate --reference %cachePath% ';
|
||||||
|
$transportOptions = $package->getTransportOptions();
|
||||||
|
if (isset($transportOptions['git']['single_use_clone']) && $transportOptions['git']['single_use_clone']) {
|
||||||
|
$cloneFlags = '';
|
||||||
|
}
|
||||||
|
|
||||||
$command =
|
$command =
|
||||||
'git clone --no-checkout %cachePath% %path% --dissociate --reference %cachePath% '
|
'git clone --no-checkout %cachePath% %path% ' . $cloneFlags
|
||||||
. '&& cd '.$flag.'%path% '
|
. '&& cd '.$flag.'%path% '
|
||||||
. '&& git remote set-url origin -- %sanitizedUrl% && git remote add composer -- %sanitizedUrl%';
|
. '&& git remote set-url origin -- %sanitizedUrl% && git remote add composer -- %sanitizedUrl%';
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue