tap: revert caching Tap.reverse_tap_migrations_renames

This could cause problems if a tap is installed during the lifetime
of the program which happens occasionally with `Tap#ensure_installed!`.

It also seems to be slow mainly because of intermediate arrays and
Pathname objects that get created in `Tap.each`. Maybe that should
be optimized instead.
This commit is contained in:
apainintheneck 2024-03-02 11:31:04 -08:00
parent 4e65af0391
commit fb055f7aaf

View File

@ -820,7 +820,7 @@ class Tap
sig { returns(T::Hash[String, T::Array[String]]) }
def self.reverse_tap_migrations_renames
cache[:reverse_tap_migrations_renames] ||= Tap.each_with_object({}) do |tap, hash|
Tap.each_with_object({}) do |tap, hash|
tap.tap_migrations.each do |old_name, new_name|
new_tap_user, new_tap_repo, new_name = new_name.split("/", 3)
next unless new_name