Ver código fonte

Fix: Bitbucket getChangeDate throws exception for branches containing a slash

Stephan Vock 6 anos atrás
pai
commit
896d801a30
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      src/Composer/Repository/Vcs/BitbucketDriver.php

+ 7 - 0
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,