Skip to content

Commit

Permalink
Make sure we do not try to update same dependency (and create same br… (
Browse files Browse the repository at this point in the history
#274)

* Make sure we do not try to update same dependency (and create same branch) twice

* Update IndirectWithDirectFilterer.php
  • Loading branch information
eiriksm committed Dec 22, 2022
1 parent 966621e commit b3fe865
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/ListFilterer/IndirectWithDirectFilterer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,28 @@ public function filter(array $list) : array
return $return;
}, $new_list);
$return = [];
$already_added_register = [];
foreach ($list_of_lists as $list_list) {
foreach ($list_list as $item) {
if (empty($item->child_with_update)) {
continue;
}
if (empty($item->name)) {
continue;
}
if ($item->child_with_update !== $item->name) {
continue;
}
$already_added_register[$item->name] = true;
$return[] = $item;
}
}
foreach ($list_of_lists as $list_list) {
foreach ($list_list as $item) {
if (!empty($already_added_register[$item->name])) {
continue;
}
$already_added_register[$item->name] = true;
$return[] = $item;
}
}
Expand Down

0 comments on commit b3fe865

Please sign in to comment.