mirror of
https://github.com/discourse/discourse.git
synced 2025-02-23 00:04:59 +08:00

Running `update_from_remote` and `save!` cause a number of side-effects, including instructing all clients to reload CSS files. If there are no changes, then this is wasteful, and can even cause a 'flicker' effect on clients as they reload CSS. This commit checks if any updates are available before triggering `update_from_remote` / `save!`. This should be much faster, and stop the 'flickering' UX from happening on every themes:update run. It also improves the output of the command to include the from/to commit hashes, which may be useful for debugging issues. For example: ``` Checking 'Alien Night | A Dark Discourse Theme' for 'default'... already up to date Checking 'Star Wars' for 'default'... updating from d8a170dd to 66b9756f Checking 'Media Overlay' for 'default'... already up to date ```