DEV: Cleanup after remote update check (#12887)

DEV: Cleanup after remote update check (#12887)

Checking for remote should cleanup after itself. Currently each check litters the /tmp filesystem with checkouts. This patch ensures that update checks keep the system a bit tidier.

diff --git a/app/models/remote_theme.rb b/app/models/remote_theme.rb
index 55ac13f..80e515c 100644
--- a/app/models/remote_theme.rb
+++ b/app/models/remote_theme.rb
@@ -125,6 +125,11 @@ class RemoteTheme < ActiveRecord::Base
       self.last_error_text = nil
     ensure
       self.save!
+      begin
+        importer.cleanup!
+      rescue => e
+        Rails.logger.warn("Failed cleanup remote git #{e}")
+      end
     end
   end
 

GitHub sha: 0abb2722

This commit appears in #12887 which was approved by davidtaylorhq. It was merged by featheredtoast.