From ca6adfbdd6c8c648eaec740031adf06f51b73bdf Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Tue, 5 Nov 2019 11:52:04 -0500 Subject: [PATCH] DEV: Ignore renames when diffing theme changes Renamed assets are quite noisy when checking whether a remote theme has local changes. --- lib/theme_store/git_importer.rb | 2 +- spec/models/remote_theme_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/theme_store/git_importer.rb b/lib/theme_store/git_importer.rb index 8fe88cfeb22..b844547e7db 100644 --- a/lib/theme_store/git_importer.rb +++ b/lib/theme_store/git_importer.rb @@ -40,7 +40,7 @@ class ThemeStore::GitImporter Discourse::Utils.execute_command("git", "checkout", "about.json") # adding and diffing on staged so that we catch uploads Discourse::Utils.execute_command("git", "add", "-A") - return Discourse::Utils.execute_command("git", "diff", "--staged") + return Discourse::Utils.execute_command("git", "diff", "--staged", "--no-renames") end ensure FileUtils.rm_rf local_temp_folder if local_temp_folder diff --git a/spec/models/remote_theme_spec.rb b/spec/models/remote_theme_spec.rb index f27c73242d3..e1e8af9fb46 100644 --- a/spec/models/remote_theme_spec.rb +++ b/spec/models/remote_theme_spec.rb @@ -170,6 +170,7 @@ describe RemoteTheme do @theme.save @theme.reload + expect(remote.diff_local_changes[:diff]).not_to include("similarity index 100%") expect(remote.diff_local_changes[:diff]).to include("background-color: blue") end end