summaryrefslogtreecommitdiff
path: root/t/t5321-pack-large-objects.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-10-16 21:02:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-19 05:28:44 (GMT)
commit34204c81668324480e1f34a09cce9c21fabf4b40 (patch)
tree425bb0225afcf92e77112573719105b7c70fc59e /t/t5321-pack-large-objects.sh
parent9308f45a9f1e3e107ba53a91d0f0c59342cb32bd (diff)
downloadgit-34204c81668324480e1f34a09cce9c21fabf4b40.zip
git-34204c81668324480e1f34a09cce9c21fabf4b40.tar.gz
git-34204c81668324480e1f34a09cce9c21fabf4b40.tar.bz2
pack-objects (mingw): initialize `packing_data` mutex in the correct spot
In 9ac3f0e5b3e4 (pack-objects: fix performance issues on packing large deltas, 2018-07-22), a mutex was introduced that is used to guard the call to set the delta size. This commit even added code to initialize it, but at an incorrect spot: in `init_threaded_search()`, while the call to `oe_set_delta_size()` (and hence to `packing_data_lock()`) can happen in the call chain `check_object()` <- `get_object_details()` <- `prepare_pack()` <- `cmd_pack_objects()`, which is long before the `prepare_pack()` function calls `ll_find_deltas()` (which initializes the threaded search). Another tell-tale that the mutex was initialized in an incorrect spot is that the function to initialize it lives in builtin/, while the code that uses the mutex is defined in a libgit.a header file. Let's use a more appropriate function: `prepare_packing_data()`, which not only lives in libgit.a, but *has* to be called before the `packing_data` struct is used that contains that mutex. This fixes https://github.com/git-for-windows/git/issues/1839. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5321-pack-large-objects.sh')
-rwxr-xr-xt/t5321-pack-large-objects.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t5321-pack-large-objects.sh b/t/t5321-pack-large-objects.sh
index c36c66f..a75eab8 100755
--- a/t/t5321-pack-large-objects.sh
+++ b/t/t5321-pack-large-objects.sh
@@ -24,7 +24,7 @@ test_expect_success 'setup' '
git index-pack --stdin <ab.pack
'
-test_expect_failure 'repack large deltas' '
+test_expect_success 'repack large deltas' '
printf "%s\\n" $A $B |
GIT_TEST_OE_DELTA_SIZE=2 git pack-objects tmp-pack
'