test-bot: run git gc on cleanup.

Closes Homebrew/homebrew#42805.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2015-08-11 14:18:26 +01:00
parent 36272dbaa6
commit 3350f9018a

View File

@ -575,6 +575,7 @@ module Homebrew
def cleanup_before def cleanup_before
@category = __method__ @category = __method__
return unless ARGV.include? "--cleanup" return unless ARGV.include? "--cleanup"
git "gc", "--auto"
git "stash" git "stash"
git "am", "--abort" git "am", "--abort"
git "rebase", "--abort" git "rebase", "--abort"
@ -604,6 +605,7 @@ module Homebrew
test "git", "reset", "--hard" test "git", "reset", "--hard"
git "stash", "pop" git "stash", "pop"
test "brew", "cleanup", "--prune=30" test "brew", "cleanup", "--prune=30"
git "gc", "--auto"
end end
FileUtils.rm_rf @brewbot_root unless ARGV.include? "--keep-logs" FileUtils.rm_rf @brewbot_root unless ARGV.include? "--keep-logs"