themes:install: minor refactoring of checking out a ref