소스 검색

Prevent duplicate file checking on git download.

Marco Villegas 8 년 전
부모
커밋
44f94a7b83
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/Composer/Downloader/GitDownloader.php

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

@@ -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);