From ec6d727af8a670b9c98cacb3bc17a9b5dbfec91d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 15 Apr 2015 02:48:10 +0100 Subject: [PATCH] Add comment about --, refs #3853 --- src/Composer/Downloader/GitDownloader.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index 12e5a2a5d..70c9ae435 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/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);