test-bot: exclude Taps dir from root cleanup

This commit is contained in:
Andrew Janke 2016-04-03 01:29:28 -04:00 committed by Xu Cheng
parent 6283a274c8
commit e70a3552d3

View File

@ -645,7 +645,7 @@ module Homebrew
safe_system "git", "checkout", "-f", "master" safe_system "git", "checkout", "-f", "master"
# This will uninstall all formulae, as long as # This will uninstall all formulae, as long as
# HOMEBREW_REPOSITORY == HOMEBREW_PREFIX, which is true on the test bots # HOMEBREW_REPOSITORY == HOMEBREW_PREFIX, which is true on the test bots
safe_system "git", "clean", "-ffdx" unless ENV["HOMEBREW_RUBY"] == "1.8.7" safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" unless ENV["HOMEBREW_RUBY"] == "1.8.7"
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 }
@ -669,7 +669,7 @@ module Homebrew
test "git", "clean", "-ffdx" test "git", "clean", "-ffdx"
HOMEBREW_REPOSITORY.cd do HOMEBREW_REPOSITORY.cd do
safe_system "git", "reset", "--hard" safe_system "git", "reset", "--hard"
safe_system "git", "clean", "-ffdx" safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/"
end end
if ARGV.include? "--local" if ARGV.include? "--local"
FileUtils.rm_rf ENV["HOMEBREW_HOME"] FileUtils.rm_rf ENV["HOMEBREW_HOME"]