1
0
Fork 0

Fix detached head handling for non-committish sources, fixes #2732

pull/2750/head
Jordi Boggiano 2014-02-23 17:13:38 +01:00
parent 3fb216b703
commit 714a47ef93
1 changed files with 1 additions and 1 deletions

View File

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