1
0
Fork 0

Add comment about --, refs #3853

pull/3899/merge
Jordi Boggiano 2015-04-15 02:48:10 +01:00
parent e50b5fe990
commit ec6d727af8
1 changed files with 5 additions and 0 deletions

View File

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