Merge pull request #15866 from MikeMcQuaid/update_report_sharding_add_delete

cmd/update-report: correctly handle added/deleted formulae/casks.
This commit is contained in:
Bo Anderson 2023-08-15 03:07:50 +01:00 committed by GitHub
commit d30b68715f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -566,6 +566,17 @@ class Reporter
@report[:R] = renamed_formulae.to_a
end
# If any formulae/casks are marked as added and deleted, remove them from
# the report as we've not detected things correctly.
if (added_and_deleted_formulae = (@report[:A] & @report[:D]).presence)
@report[:A] -= added_and_deleted_formulae
@report[:D] -= added_and_deleted_formulae
end
if (added_and_deleted_casks = (@report[:AC] & @report[:DC]).presence)
@report[:AC] -= added_and_deleted_casks
@report[:DC] -= added_and_deleted_casks
end
@report
end