Skip to content

A platform for community discussion. Free, open, simple.

DEV: Ignore renames when diffing theme changes

Penar Musarajca6adfbdd6c8
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