1
0
Fork 0

Merge pull request #4989 from naderman/t/fix-self-reference-transaction-root

Ignore self references when anlaysing independent root requirements
pull/4993/head
Jordi Boggiano 2016-03-02 13:26:18 +00:00
commit 76450cc2a1
2 changed files with 39 additions and 1 deletions

View File

@ -165,10 +165,12 @@ class Transaction
$possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
foreach ($possibleRequires as $require) {
if ($require !== $package) {
unset($roots[$require->id]);
}
}
}
}
return $roots;
}

View File

@ -0,0 +1,36 @@
--TEST--
Circular dependencies are possible between packages
--COMPOSER--
{
"name": "root",
"version": "dev-master",
"require": {
"require/itself": "1.0.0",
"regular/pkg": "1.0.0"
},
"repositories": [
{
"type": "package",
"package": [
{
"name": "require/itself",
"version": "1.0.0",
"source": { "reference": "some.branch", "type": "git", "url": "" },
"require": {
"require/itself": "1.0.0"
}
},
{
"name": "regular/pkg",
"version": "1.0.0",
"source": { "reference": "some.branch", "type": "git", "url": "" }
}
]
}
]
}
--RUN--
update -v
--EXPECT--
Installing require/itself (1.0.0)
Installing regular/pkg (1.0.0)