1
0
Fork 0

Prevent duplicate file checking on git download.

pull/5384/head
Marco Villegas 2016-06-18 18:07:53 -05:00
parent 75b88a13fe
commit 44f94a7b83
1 changed files with 2 additions and 1 deletions

View File

@ -43,6 +43,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
GitUtil::cleanEnv();
$path = $this->normalizePath($path);
$cachePath = $this->config->get('cache-vcs-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $url).'/';
$cacheOptions = '';
$ref = $package->getSourceReference();
$flag = Platform::isWindows() ? '/D ' : '';
@ -56,8 +57,8 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
};
$this->gitUtil->runCommand($mirrorCommandCallable, $url, $path, true);
}
$cacheOptions = sprintf('--dissociate --reference %s ', ProcessExecutor::escape($cachePath));
}
$cacheOptions = file_exists($cachePath) ? '--dissociate --reference '.ProcessExecutor::escape($cachePath).' ' : '';
$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);