Skip to content

Commit

Permalink
Fix line wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Sep 8, 2020
1 parent 9dc125f commit 7859fe7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Composer/Package/Version/VersionGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ private function guessGitVersion(array $packageConfig, $path)
// find current branch and collect all branch names
foreach ($this->process->splitLines($output) as $branch) {
if ($branch && preg_match('{^(?:\* ) *(\(no branch\)|\(detached from \S+\)|\(HEAD detached at \S+\)|\S+) *([a-f0-9]+) .*$}', $branch, $match)) {
if ($match[1] === '(no branch)' || strpos($match[1], '(detached ') === 0 || strpos($match[1],
'(HEAD detached at') === 0) {
if (
$match[1] === '(no branch)'
|| strpos($match[1], '(detached ') === 0
|| strpos($match[1], '(HEAD detached at') === 0
) {
$version = 'dev-' . $match[2];
$prettyVersion = $version;
$isFeatureBranch = true;
Expand Down

0 comments on commit 7859fe7

Please sign in to comment.