Fix version guessing when used on feature branches
parent
59edd4e6d6
commit
61a3c50436
|
@ -165,6 +165,7 @@ class RootPackageLoader extends ArrayLoader
|
||||||
$isFeatureBranch = false;
|
$isFeatureBranch = false;
|
||||||
$version = null;
|
$version = null;
|
||||||
|
|
||||||
|
// 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('{^(?:\* ) *(?:[^/ ]+?/)?(\S+|\(no branch\)) *([a-f0-9]+) .*$}', $branch, $match)) {
|
if ($branch && preg_match('{^(?:\* ) *(?:[^/ ]+?/)?(\S+|\(no branch\)) *([a-f0-9]+) .*$}', $branch, $match)) {
|
||||||
if ($match[1] === '(no branch)') {
|
if ($match[1] === '(no branch)') {
|
||||||
|
@ -199,7 +200,7 @@ class RootPackageLoader extends ArrayLoader
|
||||||
$length = PHP_INT_MAX;
|
$length = PHP_INT_MAX;
|
||||||
foreach ($branches as $candidate) {
|
foreach ($branches as $candidate) {
|
||||||
// do not compare against other feature branches
|
// do not compare against other feature branches
|
||||||
if ($candidate === $branch || !preg_match('{^(master|trunk|default|develop|\d+\..+)$}', $candidate)) {
|
if ($candidate === $branch || !preg_match('{^(master|trunk|default|develop|\d+\..+)$}', $candidate, $match)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (0 !== $this->process->execute('git rev-list '.$candidate.'..'.$branch, $output)) {
|
if (0 !== $this->process->execute('git rev-list '.$candidate.'..'.$branch, $output)) {
|
||||||
|
|
Loading…
Reference in New Issue