Merge pull request #9706 from Seldaek/fix-default-branch-handling
Remove default branch alias from versions which are numericpull/9682/head
commit
2bceb1e0c2
|
@ -375,7 +375,12 @@ class ArrayLoader implements LoaderInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['default-branch']) && $config['default-branch'] === true) {
|
|
||||||
|
if (
|
||||||
|
isset($config['default-branch'])
|
||||||
|
&& $config['default-branch'] === true
|
||||||
|
&& false === $this->versionParser->parseNumericAliasPrefix($config['version'])
|
||||||
|
) {
|
||||||
return VersionParser::DEFAULT_BRANCH_ALIAS;
|
return VersionParser::DEFAULT_BRANCH_ALIAS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
--TEST--
|
||||||
|
Test that a conflict against >=5 does not include the default branch if it is a numeric branch.
|
||||||
|
--COMPOSER--
|
||||||
|
{
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "package",
|
||||||
|
"package": [
|
||||||
|
{ "name": "conflicter/pkg", "version": "1.0.0", "conflict": { "victim/pkg": ">=5", "victim/pkg2": ">=5" } },
|
||||||
|
{ "name": "victim/pkg", "version": "3.x-dev", "default-branch": true },
|
||||||
|
{ "name": "victim/pkg2", "version": "dev-foo" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"conflicter/pkg": "1.0.0",
|
||||||
|
"victim/pkg": "*",
|
||||||
|
"victim/pkg2": "*"
|
||||||
|
},
|
||||||
|
"minimum-stability": "dev"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--RUN--
|
||||||
|
update
|
||||||
|
|
||||||
|
--EXPECT--
|
||||||
|
Installing conflicter/pkg (1.0.0)
|
||||||
|
Installing victim/pkg (3.x-dev)
|
||||||
|
Installing victim/pkg2 (dev-foo)
|
Loading…
Reference in New Issue