1
0
Fork 0

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

pull/5979/head
Jordi Boggiano 2016-12-18 14:50:55 +01:00
parent 01885777f3
commit 1bc8b702ca
1 changed files with 2 additions and 2 deletions

View File

@ -154,9 +154,9 @@ class GitDriver extends VcsDriver
if (null === $this->tags) { if (null === $this->tags) {
$this->tags = array(); $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) { 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]; $this->tags[$match[2]] = $match[1];
} }
} }