Explorar o código

Fix: Bitbucket getChangeDate throws exception for branches containing a slash

Stephan Vock %!s(int64=6) %!d(string=hai) anos
pai
achega
e37ffb2a44
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  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,