test-bot: don't cleanup brew repo twice.

This commit is contained in:
Mike McQuaid 2016-07-15 13:10:39 +01:00
parent 3995d237dd
commit ec1da60941

View File

@ -683,12 +683,16 @@ module Homebrew
git "reset", "--hard" git "reset", "--hard"
git "checkout", "-f", "master" git "checkout", "-f", "master"
git "clean", "-ffdx" git "clean", "-ffdx"
HOMEBREW_REPOSITORY.cd do unless @repository == HOMEBREW_REPOSITORY
safe_system "git", "reset", "--hard" HOMEBREW_REPOSITORY.cd do
safe_system "git", "checkout", "-f", "master" safe_system "git", "reset", "--hard"
# This will uninstall all formulae, as long as safe_system "git", "checkout", "-f", "master"
# HOMEBREW_REPOSITORY == HOMEBREW_PREFIX, which is true on the test bots # This will uninstall all formulae, as long as
safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" unless ENV["HOMEBREW_RUBY"] == "1.8.7" # 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 end
pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock" pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock"
Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock } Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }