diff --git a/src/Composer/Repository/Vcs/GitLabDriver.php b/src/Composer/Repository/Vcs/GitLabDriver.php index d50ea1f37..00f656f30 100644 --- a/src/Composer/Repository/Vcs/GitLabDriver.php +++ b/src/Composer/Repository/Vcs/GitLabDriver.php @@ -19,6 +19,7 @@ use Composer\Json\JsonFile; use Composer\Downloader\TransportException; use Composer\Util\RemoteFilesystem; use Composer\Util\GitLab; + /** * Driver for GitLab API, use the Git driver for local checkouts. * @@ -260,7 +261,6 @@ class GitLabDriver extends VcsDriver protected function attemptCloneFallback() { - try { // If this repository may be private and we // cannot ask for authentication credentials (because we diff --git a/src/Composer/Util/Git.php b/src/Composer/Util/Git.php index e0b9024f9..6b61ac2d2 100644 --- a/src/Composer/Util/Git.php +++ b/src/Composer/Util/Git.php @@ -88,7 +88,6 @@ class Git if ($bypassSshForGitHub || 0 !== $this->process->execute($command, $ignoredOutput, $cwd)) { // private github repository without git access, try https with auth if (preg_match('{^git@'.self::getGitHubDomainsRegex($this->config).':(.+?)\.git$}i', $url, $match)) { - if (!$this->io->hasAuthentication($match[1])) { $gitHubUtil = new GitHub($this->io, $this->config, $this->process); $message = 'Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos'; diff --git a/src/Composer/Util/GitLab.php b/src/Composer/Util/GitLab.php index 499cc492d..8f2b0aec2 100644 --- a/src/Composer/Util/GitLab.php +++ b/src/Composer/Util/GitLab.php @@ -3,8 +3,8 @@ /* * This file is part of Composer. * - * (c) Roshan Gautam - * + * (c) Nils Adermann + * Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index fe9c114c1..5c9815550 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -488,7 +488,7 @@ class RemoteFilesystem if ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) { $options['github-token'] = $auth['username']; } elseif ($this->config && in_array($originUrl, $this->config->get('gitlab-domains'), true)) { - if($auth['password'] === 'oauth2') { + if ($auth['password'] === 'oauth2') { $headers[] = 'Authorization: Bearer '.$auth['username']; } } else { diff --git a/tests/Composer/Test/Util/GitLabTest.php b/tests/Composer/Test/Util/GitLabTest.php index 2c5e62527..e4d264055 100644 --- a/tests/Composer/Test/Util/GitLabTest.php +++ b/tests/Composer/Test/Util/GitLabTest.php @@ -1,14 +1,14 @@ -* Jordi Boggiano -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * This file is part of Composer. + * + * (c) Nils Adermann + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Composer\Test\Util;