1
0
Fork 0

Merge branch '1.3'

pull/6174/merge
Jordi Boggiano 2017-03-06 14:09:36 +01:00
commit 34d7e26f25
1 changed files with 3 additions and 1 deletions

View File

@ -89,6 +89,7 @@ class VersionGuesser
$commit = null; $commit = null;
$version = null; $version = null;
$prettyVersion = null; $prettyVersion = null;
$isDetached = false;
// try to fetch current version from git branch // try to fetch current version from git branch
if (0 === $this->process->execute('git branch --no-color --no-abbrev -v', $output, $path)) { if (0 === $this->process->execute('git branch --no-color --no-abbrev -v', $output, $path)) {
@ -102,6 +103,7 @@ class VersionGuesser
$version = 'dev-' . $match[2]; $version = 'dev-' . $match[2];
$prettyVersion = $version; $prettyVersion = $version;
$isFeatureBranch = true; $isFeatureBranch = true;
$isDetached = true;
} else { } else {
$version = $this->versionParser->normalizeBranch($match[1]); $version = $this->versionParser->normalizeBranch($match[1]);
$prettyVersion = 'dev-' . $match[1]; $prettyVersion = 'dev-' . $match[1];
@ -131,7 +133,7 @@ class VersionGuesser
} }
} }
if (!$version) { if (!$version || $isDetached) {
$result = $this->versionFromGitTags($path); $result = $this->versionFromGitTags($path);
if ($result) { if ($result) {
$version = $result['version']; $version = $result['version'];