@@ -51,7 +51,7 @@ public function doDownload(PackageInterface $package, $path, $url)
51
51
$ gitVersion = GitUtil::getVersion ($ this ->process );
52
52
$ msg = "Cloning " .$ this ->getShortHash ($ ref );
53
53
54
- $ command = 'git clone --no-checkout %url% %path% && cd ' .$ flag .'%path% && git remote add composer %url% && git fetch composer && git remote set-url origin %sanitizedUrl% && git remote set-url composer %sanitizedUrl% ' ;
54
+ $ command = 'git clone --no-checkout -- %url% %path% && cd ' .$ flag .'%path% && git remote add composer -- %url% && git fetch composer && git remote set-url origin -- %sanitizedUrl% && git remote set-url composer -- %sanitizedUrl% ' ;
55
55
if ($ gitVersion && version_compare ($ gitVersion , '2.3.0-rc0 ' , '>= ' ) && Cache::isUsable ($ cachePath )) {
56
56
$ this ->io ->writeError ('' , true , IOInterface::DEBUG );
57
57
$ this ->io ->writeError (sprintf (' Cloning to cache at %s ' , ProcessExecutor::escape ($ cachePath )), true , IOInterface::DEBUG );
@@ -63,7 +63,7 @@ public function doDownload(PackageInterface $package, $path, $url)
63
63
$ command =
64
64
'git clone --no-checkout %cachePath% %path% --dissociate --reference %cachePath% '
65
65
. '&& cd ' .$ flag .'%path% '
66
- . '&& git remote set-url origin %sanitizedUrl% && git remote add composer %sanitizedUrl% ' ;
66
+ . '&& git remote set-url origin -- %sanitizedUrl% && git remote add composer -- %sanitizedUrl% ' ;
67
67
$ msg = "Cloning " .$ this ->getShortHash ($ ref ).' from cache ' ;
68
68
}
69
69
} catch (\RuntimeException $ e ) {
@@ -125,7 +125,7 @@ public function doUpdate(PackageInterface $initial, PackageInterface $target, $p
125
125
126
126
$ ref = $ target ->getSourceReference ();
127
127
$ this ->io ->writeError (" Checking out " .$ this ->getShortHash ($ ref ));
128
- $ command = '(git remote set-url composer %s && git rev-parse --quiet --verify %s || (git fetch composer && git fetch --tags composer)) && git remote set-url composer %s ' ;
128
+ $ command = '(git remote set-url composer -- %s && git rev-parse --quiet --verify %s || (git fetch composer && git fetch --tags composer)) && git remote set-url composer -- %s ' ;
129
129
130
130
$ commandCallable = function ($ url ) use ($ command , $ ref ) {
131
131
return sprintf (
@@ -411,7 +411,7 @@ protected function updateToCommit($path, $reference, $branch, $date)
411
411
412
412
protected function updateOriginUrl ($ path , $ url )
413
413
{
414
- $ this ->process ->execute (sprintf ('git remote set-url origin %s ' , ProcessExecutor::escape ($ url )), $ output , $ path );
414
+ $ this ->process ->execute (sprintf ('git remote set-url origin -- %s ' , ProcessExecutor::escape ($ url )), $ output , $ path );
415
415
$ this ->setPushUrl ($ path , $ url );
416
416
}
417
417
@@ -424,7 +424,7 @@ protected function setPushUrl($path, $url)
424
424
if (!in_array ('ssh ' , $ protocols , true )) {
425
425
$ pushUrl = 'https:// ' . $ match [1 ] . '/ ' .$ match [2 ].'/ ' .$ match [3 ].'.git ' ;
426
426
}
427
- $ cmd = sprintf ('git remote set-url --push origin %s ' , ProcessExecutor::escape ($ pushUrl ));
427
+ $ cmd = sprintf ('git remote set-url --push origin -- %s ' , ProcessExecutor::escape ($ pushUrl ));
428
428
$ this ->process ->execute ($ cmd , $ ignoredOutput , $ path );
429
429
}
430
430
}
0 commit comments