From 985cef790f07c7b541badfcfd9913e6da7356244 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 30 Oct 2020 17:15:25 +0100 Subject: [PATCH] Support git@bitbucket.org URLs for git-bitbucket driver --- src/Composer/Repository/Vcs/BitbucketDriver.php | 2 +- src/Composer/Repository/Vcs/GitBitbucketDriver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/Vcs/BitbucketDriver.php b/src/Composer/Repository/Vcs/BitbucketDriver.php index 61dc37f8e..b1f0c9db1 100644 --- a/src/Composer/Repository/Vcs/BitbucketDriver.php +++ b/src/Composer/Repository/Vcs/BitbucketDriver.php @@ -44,7 +44,7 @@ abstract class BitbucketDriver extends VcsDriver */ public function initialize() { - preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+?)(\.git|/?)$#i', $this->url, $match); + preg_match('#^(?:https?://bitbucket\.org/|git@bitbucket\.org:)([^/]+)/([^/]+?)(\.git|/?)$#i', $this->url, $match); $this->owner = $match[1]; $this->repository = $match[2]; $this->originUrl = 'bitbucket.org'; diff --git a/src/Composer/Repository/Vcs/GitBitbucketDriver.php b/src/Composer/Repository/Vcs/GitBitbucketDriver.php index 08dbe9233..a8d7bf1bc 100644 --- a/src/Composer/Repository/Vcs/GitBitbucketDriver.php +++ b/src/Composer/Repository/Vcs/GitBitbucketDriver.php @@ -53,7 +53,7 @@ class GitBitbucketDriver extends BitbucketDriver */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { - if (!preg_match('#^https?://bitbucket\.org/([^/]+)/(.+?)\.git$#i', $url)) { + if (!preg_match('#^(?:https?://bitbucket\.org/|git@bitbucket\.org:)([^/]+)/(.+?)\.git$#i', $url)) { return false; }