Sfoglia il codice sorgente

Merge pull request #7632 from glaubinix/f/bitbucket-get-change-date-branch-with-slash

Fix: Bitbucket getChangeDate throws exception for branches containing a slash
Jordi Boggiano 6 anni fa
parent
commit
55fec6575f
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  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,