diff options
| author | Mike McQuaid | 2016-09-11 14:40:09 +0100 |
|---|---|---|
| committer | GitHub | 2016-09-11 14:40:09 +0100 |
| commit | a54ee597d0c38f5d2c60e87372b1c26a9a2a877b (patch) | |
| tree | b82351fe31046a68b073984dcfd1e728cd7e0a3a /Library | |
| parent | 6c0072d0f4796d1092ee819f68c742e5b02e5cbb (diff) | |
| parent | f583199f6e24ceaa2f79b7436fb6169b99441928 (diff) | |
| download | brew-a54ee597d0c38f5d2c60e87372b1c26a9a2a877b.tar.bz2 | |
Merge pull request #921 from MikeMcQuaid/test-bot-no-clean-taps
test-bot: don't try to `git clean` any taps.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/dev-cmd/test-bot.rb | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb index a129bd8d3..7d95d2ebb 100644 --- a/Library/Homebrew/dev-cmd/test-bot.rb +++ b/Library/Homebrew/dev-cmd/test-bot.rb @@ -724,18 +724,15 @@ module Homebrew end end - def cleanup_before - @category = __method__ - return unless ARGV.include? "--cleanup" + def cleanup_git git "gc", "--auto" - git "stash" - git "am", "--abort" - git "rebase", "--abort" - unless ARGV.include? "--no-pull" - git "checkout", "-f", "master" - git "reset", "--hard", "origin/master" + test "git", "clean", "-ffdx", "--exclude=Library/Taps" + + Tap.names.each do |tap| + next if tap == "homebrew/core" + next if tap == @tap.to_s + safe_system "brew", "untap", tap end - git "clean", "-ffdx", "--exclude=Library/Taps/homebrew/homebrew-core" unless @repository == HOMEBREW_REPOSITORY HOMEBREW_REPOSITORY.cd do @@ -752,6 +749,20 @@ module Homebrew safe_system "git", "reset", "--hard", "origin/master" end end + end + + def cleanup_before + @category = __method__ + return unless ARGV.include? "--cleanup" + git "stash" + git "am", "--abort" + git "rebase", "--abort" + unless ARGV.include? "--no-pull" + git "checkout", "-f", "master" + git "reset", "--hard", "origin/master" + end + + cleanup_git pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock" Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock } @@ -771,26 +782,8 @@ module Homebrew git "reset", "--hard", "origin/master" git "stash", "pop" test "brew", "cleanup", "--prune=7" - git "gc", "--auto" - test "git", "clean", "-ffdx", "--exclude=Library/Taps/homebrew/homebrew-core" - - Tap.names.each { |s| safe_system "brew", "untap", s if s != "homebrew/core" } - unless @repository == HOMEBREW_REPOSITORY - HOMEBREW_REPOSITORY.cd do - safe_system "git", "checkout", "-f", "master" - safe_system "git", "reset", "--hard", "origin/master" - safe_system "git", "clean", "-ffdx", "--exclude=Library/Taps" - end - end - - Pathname.glob("#{HOMEBREW_LIBRARY}/Taps/*/*").each do |git_repo| - next if @repository == git_repo - git_repo.cd do - safe_system "git", "checkout", "-f", "master" - safe_system "git", "reset", "--hard", "origin/master" - end - end + cleanup_git if ARGV.include? "--local" FileUtils.rm_rf ENV["HOMEBREW_HOME"] |
