DEV: Do less work in docker_test (#9470)

DEV: Do less work in docker_test (#9470)

  • DEV: Update the working tree just once.

git pull was effectively doing git fetch and git merge FETCH_HEAD, and only then we were checking out the desired branch/commit. This change will skip the the merge step.

  • DEV: Don’t run lefthook in docker_test
diff --git a/script/docker_test.rb b/script/docker_test.rb
index 445901b..3696a53 100644
--- a/script/docker_test.rb
+++ b/script/docker_test.rb
@@ -26,10 +26,10 @@ unless ENV['NO_UPDATE']
   run_or_fail("git reset --hard")
-  run_or_fail("git pull")
+  run_or_fail("git fetch")
-  checkout = ENV['COMMIT_HASH'] || "HEAD"
-  run_or_fail("git checkout #{checkout}")
+  checkout = ENV['COMMIT_HASH'] || "FETCH_HEAD"
+  run_or_fail("LEFTHOOK=0 git checkout #{checkout}")
   puts "travis_fold:end:pulling_latest_discourse" if ENV["TRAVIS"]
   puts "travis_fold:start:bundle" if ENV["TRAVIS"]

GitHub sha: 28c706bd

This commit appears in #9470 which was approved by eviltrout. It was merged by CvX.