Only update the git repo if the commit we want doesn't exist, speeds up update from source
parent
66efc9af86
commit
5dfd23668e
|
@ -105,10 +105,10 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
|
||||||
|
|
||||||
$ref = $target->getSourceReference();
|
$ref = $target->getSourceReference();
|
||||||
$this->io->writeError(" Checking out ".$ref);
|
$this->io->writeError(" Checking out ".$ref);
|
||||||
$command = 'git remote set-url composer %s && git fetch composer && git fetch --tags composer';
|
$command = 'git remote set-url composer %s && git rev-parse --quiet --verify %s^{commit} || (git fetch composer && git fetch --tags composer)';
|
||||||
|
|
||||||
$commandCallable = function ($url) use ($command) {
|
$commandCallable = function ($url) use ($command, $ref) {
|
||||||
return sprintf($command, ProcessExecutor::escape($url));
|
return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($ref));
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->gitUtil->runCommand($commandCallable, $url, $path);
|
$this->gitUtil->runCommand($commandCallable, $url, $path);
|
||||||
|
|
Loading…
Reference in New Issue