1
0
Fork 0

Merge branch '1.5'

pull/6637/merge
Jordi Boggiano 2017-09-11 16:02:55 +02:00
commit 4853661934
1 changed files with 11 additions and 0 deletions

View File

@ -142,6 +142,17 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
); );
$package['transport-options'] = $this->options; $package['transport-options'] = $this->options;
// carry over the root package version if this path repo is in the same git repository as root package
if (!isset($package['version']) && ($rootVersion = getenv('COMPOSER_ROOT_VERSION'))) {
if (
0 === $this->process->execute('git rev-parse HEAD', $ref1, $path)
&& 0 === $this->process->execute('git rev-parse HEAD', $ref2)
&& $ref1 === $ref2
) {
$package['version'] = $rootVersion;
}
}
if (!isset($package['version'])) { if (!isset($package['version'])) {
$versionData = $this->versionGuesser->guessVersion($package, $path); $versionData = $this->versionGuesser->guessVersion($package, $path);
$package['version'] = $versionData['version'] ?: 'dev-master'; $package['version'] = $versionData['version'] ?: 'dev-master';