Fix CS
parent
a10bffec0e
commit
020c126c27
|
@ -19,6 +19,7 @@ use Composer\Json\JsonFile;
|
||||||
use Composer\Downloader\TransportException;
|
use Composer\Downloader\TransportException;
|
||||||
use Composer\Util\RemoteFilesystem;
|
use Composer\Util\RemoteFilesystem;
|
||||||
use Composer\Util\GitLab;
|
use Composer\Util\GitLab;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Driver for GitLab API, use the Git driver for local checkouts.
|
* Driver for GitLab API, use the Git driver for local checkouts.
|
||||||
*
|
*
|
||||||
|
@ -260,7 +261,6 @@ class GitLabDriver extends VcsDriver
|
||||||
|
|
||||||
protected function attemptCloneFallback()
|
protected function attemptCloneFallback()
|
||||||
{
|
{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// If this repository may be private and we
|
// If this repository may be private and we
|
||||||
// cannot ask for authentication credentials (because we
|
// cannot ask for authentication credentials (because we
|
||||||
|
|
|
@ -88,7 +88,6 @@ class Git
|
||||||
if ($bypassSshForGitHub || 0 !== $this->process->execute($command, $ignoredOutput, $cwd)) {
|
if ($bypassSshForGitHub || 0 !== $this->process->execute($command, $ignoredOutput, $cwd)) {
|
||||||
// private github repository without git access, try https with auth
|
// private github repository without git access, try https with auth
|
||||||
if (preg_match('{^git@'.self::getGitHubDomainsRegex($this->config).':(.+?)\.git$}i', $url, $match)) {
|
if (preg_match('{^git@'.self::getGitHubDomainsRegex($this->config).':(.+?)\.git$}i', $url, $match)) {
|
||||||
|
|
||||||
if (!$this->io->hasAuthentication($match[1])) {
|
if (!$this->io->hasAuthentication($match[1])) {
|
||||||
$gitHubUtil = new GitHub($this->io, $this->config, $this->process);
|
$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';
|
$message = 'Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos';
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
/*
|
/*
|
||||||
* This file is part of Composer.
|
* This file is part of Composer.
|
||||||
*
|
*
|
||||||
* (c) Roshan Gautam <roshan.gautam@hotmail.com>
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
*
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
|
|
@ -488,7 +488,7 @@ class RemoteFilesystem
|
||||||
if ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) {
|
if ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) {
|
||||||
$options['github-token'] = $auth['username'];
|
$options['github-token'] = $auth['username'];
|
||||||
} elseif ($this->config && in_array($originUrl, $this->config->get('gitlab-domains'), true)) {
|
} 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'];
|
$headers[] = 'Authorization: Bearer '.$auth['username'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Composer.
|
* This file is part of Composer.
|
||||||
*
|
*
|
||||||
* (c) Nils Adermann <naderman@naderman.de>
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
* Jordi Boggiano <j.boggiano@seld.be>
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Composer\Test\Util;
|
namespace Composer\Test\Util;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue