From 83191c74df769f5442c615e18ed34d8a59ca0dd4 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Mon, 20 May 2013 17:19:31 +0100 Subject: themes:install: minor refactoring of checking out a ref --- lib/tasks/themes.rake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index cbd3d123e..a8d16f108 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -9,15 +9,17 @@ namespace :themes do File.join(plugin_dir, theme_name) end + def checkout(commitish) + puts "Checking out #{commitish}" if verbose + system "git checkout #{commitish}" + end + def checkout_tag(version) - checkout_command = "git checkout #{usage_tag(version)}" - success = system(checkout_command) - puts "Using tag #{usage_tag(version)}" if verbose && success - success + checkout usage_tag(version) end def checkout_remote_branch(branch) - system("git checkout origin/#{branch}") + checkout "origin/#{branch}" end def usage_tag(version) -- cgit v1.2.3