From 843877cd6d3d8b81a4b176679fc107060dfc28b5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 8 Mar 2017 17:12:00 +0100 Subject: [PATCH] Fix hg version guessing, fixes #6236, fixes #6235 --- src/Composer/Package/Version/VersionGuesser.php | 2 +- tests/Composer/Test/Package/Version/VersionGuesserTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Package/Version/VersionGuesser.php b/src/Composer/Package/Version/VersionGuesser.php index bda0f7ec6..9aca9ca53 100644 --- a/src/Composer/Package/Version/VersionGuesser.php +++ b/src/Composer/Package/Version/VersionGuesser.php @@ -179,7 +179,7 @@ class VersionGuesser } if (!$isFeatureBranch) { - return $version; + return array('version' => $version, 'commit' => null, 'pretty_version' => $version); } // re-use the HgDriver to fetch branches (this properly includes bookmarks) diff --git a/tests/Composer/Test/Package/Version/VersionGuesserTest.php b/tests/Composer/Test/Package/Version/VersionGuesserTest.php index b3af71cc9..52488dacc 100644 --- a/tests/Composer/Test/Package/Version/VersionGuesserTest.php +++ b/tests/Composer/Test/Package/Version/VersionGuesserTest.php @@ -88,7 +88,7 @@ class VersionGuesserTest extends \PHPUnit_Framework_TestCase $guesser = new VersionGuesser($config, $executor, new VersionParser()); $versionArray = $guesser->guessVersion(array(), 'dummy/path'); - $this->assertEquals($branch, $versionArray['version']); + $this->assertEquals('dev-' . $branch, $versionArray['version']); $this->assertEmpty($versionArray['commit']); }