From 1bc8b702ca40ec9f912539cecdb00b61a3109c78 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 18 Dec 2016 14:50:55 +0100 Subject: [PATCH] Fix handling of annotated tags and prefer them over lightweight tags, fixes #5555 --- src/Composer/Repository/Vcs/GitDriver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/Vcs/GitDriver.php b/src/Composer/Repository/Vcs/GitDriver.php index 7093ce94d..42998992d 100644 --- a/src/Composer/Repository/Vcs/GitDriver.php +++ b/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]; } }