1
0
Fork 0

Fix detection of versions with git 1.8+, fixes #2065

pull/2070/head
Jordi Boggiano 2013-07-04 23:58:13 +02:00
parent 94ff1ed8f7
commit 8766c7072b
1 changed files with 2 additions and 2 deletions

View File

@ -194,8 +194,8 @@ class RootPackageLoader extends ArrayLoader
// find current branch and collect all branch names
foreach ($this->process->splitLines($output) as $branch) {
if ($branch && preg_match('{^(?:\* ) *(\S+|\(no branch\)) *([a-f0-9]+) .*$}', $branch, $match)) {
if ($match[1] === '(no branch)') {
if ($branch && preg_match('{^(?:\* ) *(\(no branch\)|\(detached from [a-f0-9]+\)|\S+) *([a-f0-9]+) .*$}', $branch, $match)) {
if ($match[1] === '(no branch)' || substr($match[1], 0, 10) === '(detached ') {
$version = 'dev-'.$match[2];
$isFeatureBranch = true;
} else {