Browse Source

Make it clear that a package is cloned from source, fixes #5489

Jordi Boggiano 8 years ago
parent
commit
2f3db8c397
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Composer/Downloader/GitDownloader.php

+ 3 - 1
src/Composer/Downloader/GitDownloader.php

@@ -49,17 +49,19 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
 
         // --dissociate option is only available since git 2.3.0-rc0
         $gitVersion = $this->gitUtil->getVersion();
+        $msg = "    Cloning ".$ref;
         if ($gitVersion && version_compare($gitVersion, '2.3.0-rc0', '>=')) {
             $this->io->writeError(sprintf('    Cloning to cache at %s', ProcessExecutor::escape($cachePath)), true, IOInterface::DEBUG);
             try {
                 $this->gitUtil->syncMirror($url, $cachePath);
                 if (is_dir($cachePath)) {
                     $cacheOptions = sprintf('--dissociate --reference %s ', ProcessExecutor::escape($cachePath));
+                    $msg = "    Cloning ".$ref.' from cache';
                 }
             } catch (\RuntimeException $e) {}
         }
         $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) {
             return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($ref));