-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mt/parallel-checkout-part-3'
The final part of "parallel checkout". * mt/parallel-checkout-part-3: ci: run test round with parallel-checkout enabled parallel-checkout: add tests related to .gitattributes t0028: extract encoding helpers to lib-encoding.sh parallel-checkout: add tests related to path collisions parallel-checkout: add tests for basic operations checkout-index: add parallel checkout support builtin/checkout.c: complete parallel checkout support make_transient_cache_entry(): optionally alloc from mem_pool
- Loading branch information
Showing
16 changed files
with
734 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Encoding helpers | ||
|
||
test_lazy_prereq NO_UTF16_BOM ' | ||
test $(printf abc | iconv -f UTF-8 -t UTF-16 | wc -c) = 6 | ||
' | ||
|
||
test_lazy_prereq NO_UTF32_BOM ' | ||
test $(printf abc | iconv -f UTF-8 -t UTF-32 | wc -c) = 12 | ||
' | ||
|
||
write_utf16 () { | ||
if test_have_prereq NO_UTF16_BOM | ||
then | ||
printf '\376\377' | ||
fi && | ||
iconv -f UTF-8 -t UTF-16 | ||
} | ||
|
||
write_utf32 () { | ||
if test_have_prereq NO_UTF32_BOM | ||
then | ||
printf '\0\0\376\377' | ||
fi && | ||
iconv -f UTF-8 -t UTF-32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Helpers for tests invoking parallel-checkout | ||
|
||
# Parallel checkout tests need full control of the number of workers | ||
unset GIT_TEST_CHECKOUT_WORKERS | ||
|
||
set_checkout_config () { | ||
if test $# -ne 2 | ||
then | ||
BUG "usage: set_checkout_config <workers> <threshold>" | ||
fi && | ||
|
||
test_config_global checkout.workers $1 && | ||
test_config_global checkout.thresholdForParallelism $2 | ||
} | ||
|
||
# Run "${@:2}" and check that $1 checkout workers were used | ||
test_checkout_workers () { | ||
if test $# -lt 2 | ||
then | ||
BUG "too few arguments to test_checkout_workers" | ||
fi && | ||
|
||
local expected_workers=$1 && | ||
shift && | ||
|
||
local trace_file=trace-test-checkout-workers && | ||
rm -f "$trace_file" && | ||
GIT_TRACE2="$(pwd)/$trace_file" "$@" 2>&8 && | ||
|
||
local workers=$(grep "child_start\[..*\] git checkout--worker" "$trace_file" | wc -l) && | ||
test $workers -eq $expected_workers && | ||
rm "$trace_file" | ||
} 8>&2 2>&4 | ||
|
||
# Verify that both the working tree and the index were created correctly | ||
verify_checkout () { | ||
if test $# -ne 1 | ||
then | ||
BUG "usage: verify_checkout <repository path>" | ||
fi && | ||
|
||
git -C "$1" diff-index --ignore-submodules=none --exit-code HEAD -- && | ||
git -C "$1" status --porcelain >"$1".status && | ||
test_must_be_empty "$1".status | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.