1 # Helpers for tests invoking parallel-checkout
3 # Parallel checkout tests need full control of the number of workers
4 unset GIT_TEST_CHECKOUT_WORKERS
6 set_checkout_config () {
9 BUG "usage: set_checkout_config <workers> <threshold>"
12 test_config_global checkout.workers $1 &&
13 test_config_global checkout.thresholdForParallelism $2
16 # Run "${@:2}" and check that $1 checkout workers were used
17 test_checkout_workers () {
20 BUG "too few arguments to test_checkout_workers"
23 local expected_workers=$1 &&
26 local trace_file=trace-test-checkout-workers &&
27 rm -f "$trace_file" &&
28 GIT_TRACE2="$(pwd)/$trace_file" "$@" 2>&8 &&
30 local workers="$(grep "child_start\[..*\] git checkout--worker" "$trace_file" | wc -l)" &&
31 test $workers -eq $expected_workers &&
35 # Verify that both the working tree and the index were created correctly
39 BUG "usage: verify_checkout <repository path>"
42 git -C "$1" diff-index --ignore-submodules=none --exit-code HEAD -- &&
43 git -C "$1" status --porcelain >"$1".status &&
44 test_must_be_empty "$1".status