소스 검색

Fix handling of annotated tags and prefer them over lightweight tags, fixes #5555

Jordi Boggiano 8 년 전
부모
커밋
1bc8b702ca
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/Composer/Repository/Vcs/GitDriver.php

+ 2 - 2
src/Composer/Repository/Vcs/GitDriver.php

@@ -154,9 +154,9 @@ class GitDriver extends VcsDriver
         if (null === $this->tags) {
             $this->tags = array();
 
-            $this->process->execute('git show-ref --tags', $output, $this->repoDir);
+            $this->process->execute('git show-ref --tags --dereference', $output, $this->repoDir);
             foreach ($output = $this->process->splitLines($output) as $tag) {
-                if ($tag && preg_match('{^([a-f0-9]{40}) refs/tags/(\S+)$}', $tag, $match)) {
+                if ($tag && preg_match('{^([a-f0-9]{40}) refs/tags/(\S+?)(\^\{\})?$}', $tag, $match)) {
                     $this->tags[$match[2]] = $match[1];
                 }
             }