Browse Source

Fix: Bitbucket getChangeDate throws exception for branches containing a slash

Stephan Vock 5 years ago
parent
commit
e37ffb2a44
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/Composer/Repository/Vcs/BitbucketDriver.php

+ 7 - 0
src/Composer/Repository/Vcs/BitbucketDriver.php

@@ -218,6 +218,13 @@ abstract class BitbucketDriver extends VcsDriver
             return $this->fallbackDriver->getChangeDate($identifier);
         }
 
+        if (strpos($identifier, '/') !== false) {
+            $branches = $this->getBranches();
+            if (isset($branches[$identifier])) {
+                $identifier = $branches[$identifier];
+            }
+        }
+
         $resource = sprintf(
             'https://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s?fields=date',
             $this->owner,