From ec1da60941ec68fd4730519d0e44704aa55a3dce Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 15 Jul 2016 13:10:39 +0100 Subject: [PATCH] test-bot: don't cleanup brew repo twice. --- Library/Homebrew/dev-cmd/test-bot.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb index 7a9819dfaa..69fa1bd188 100644 --- a/Library/Homebrew/dev-cmd/test-bot.rb +++ b/Library/Homebrew/dev-cmd/test-bot.rb @@ -683,12 +683,16 @@ module Homebrew git "reset", "--hard" git "checkout", "-f", "master" git "clean", "-ffdx" - HOMEBREW_REPOSITORY.cd do - safe_system "git", "reset", "--hard" - safe_system "git", "checkout", "-f", "master" - # This will uninstall all formulae, as long as - # HOMEBREW_REPOSITORY == HOMEBREW_PREFIX, which is true on the test bots - safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" unless ENV["HOMEBREW_RUBY"] == "1.8.7" + unless @repository == HOMEBREW_REPOSITORY + HOMEBREW_REPOSITORY.cd do + safe_system "git", "reset", "--hard" + safe_system "git", "checkout", "-f", "master" + # This will uninstall all formulae, as long as + # HOMEBREW_REPOSITORY == HOMEBREW_PREFIX, which is true on the test bots + unless ENV["HOMEBREW_RUBY"] == "1.8.7" + safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" + end + end end pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock" Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }