From 896d801a3080b2ebefa1b2e09f49093dc00f1f9d Mon Sep 17 00:00:00 2001 From: Stephan Vock Date: Wed, 12 Sep 2018 12:01:43 -0400 Subject: [PATCH] Fix: Bitbucket getChangeDate throws exception for branches containing a slash --- src/Composer/Repository/Vcs/BitbucketDriver.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Composer/Repository/Vcs/BitbucketDriver.php b/src/Composer/Repository/Vcs/BitbucketDriver.php index 6361d6a04..64a954d43 100644 --- a/src/Composer/Repository/Vcs/BitbucketDriver.php +++ b/src/Composer/Repository/Vcs/BitbucketDriver.php @@ -189,6 +189,13 @@ abstract class BitbucketDriver extends VcsDriver return $this->fallbackDriver->getFileContent($file, $identifier); } + if (strpos($identifier, '/') !== false) { + $branches = $this->getBranches(); + if (isset($branches[$identifier])) { + $identifier = $branches[$identifier]; + } + } + $resource = sprintf( 'https://api.bitbucket.org/1.0/repositories/%s/%s/raw/%s/%s', $this->owner,