aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorXu Cheng2015-09-16 15:15:04 +0800
committerXu Cheng2015-09-18 14:24:54 +0800
commita25fc67813e5b2fff7c99edcb0de591ae8bed5e5 (patch)
treec4f7a3545a582bc34479b1db4306a07e574ecdce /Library/Homebrew/dev-cmd
parentd6a50f1e7617b40be12b7878bbcbade634c8ef86 (diff)
downloadbrew-a25fc67813e5b2fff7c99edcb0de591ae8bed5e5.tar.bz2
update-test: use git clone --local instead of copy
The .git directory in BrewTestBot is huge(1GB) which results to poor performance of `brew update-test`. Therefore, let's use `git clone --local` here which will create hard symlink to boost performance. Closes Homebrew/homebrew#44005. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/update-test.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb
index 2285dafd0..38220da26 100644
--- a/Library/Homebrew/dev-cmd/update-test.rb
+++ b/Library/Homebrew/dev-cmd/update-test.rb
@@ -2,18 +2,20 @@ require "extend/ENV"
module Homebrew
def update_test
+ cd HOMEBREW_REPOSITORY
+ start_sha1 = Utils.popen_read("git", "rev-parse", "origin/master").chomp
+ end_sha1 = Utils.popen_read("git", "rev-parse", "HEAD").chomp
+
mktemp do
curdir = Pathname.new(Dir.pwd)
oh1 "Setup test environment..."
# copy Homebrew installation
- cp_r HOMEBREW_REPOSITORY/".git", curdir/".git"
- start_sha1 = Utils.popen_read("git", "rev-parse", "origin/master").chomp
- end_sha1 = Utils.popen_read("git", "rev-parse", "HEAD").chomp
+ safe_system "git", "clone", "--local", "#{HOMEBREW_REPOSITORY}/.git", "."
# set git origin to another copy
- cp_r HOMEBREW_REPOSITORY/".git", curdir/"remote.git"
- safe_system "git", "config", "remote.origin.url", "file://#{curdir}/remote.git"
+ safe_system "git", "clone", "--local", "--bare", "#{HOMEBREW_REPOSITORY}/.git", "remote.git"
+ safe_system "git", "config", "remote.origin.url", "#{curdir}/remote.git"
# force push origin to end_sha1
safe_system "git", "checkout", "--force", "master"