소스 검색

Add comment about --, refs #3853

Jordi Boggiano 10 년 전
부모
커밋
ec6d727af8
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/Composer/Downloader/GitDownloader.php

+ 5 - 0
src/Composer/Downloader/GitDownloader.php

@@ -215,6 +215,11 @@ class GitDownloader extends VcsDownloader
      */
     protected function updateToCommit($path, $reference, $branch, $date)
     {
+        // This uses the "--" sequence to separate branch from file parameters.
+        //
+        // Otherwise git tries the branch name as well as file name.
+        // If the non-existent branch is actually the name of a file, the file
+        // is checked out.
         $template = 'git checkout %s -- && git reset --hard %1$s';
         $branch = preg_replace('{(?:^dev-|(?:\.x)?-dev$)}i', '', $branch);