summaryrefslogtreecommitdiff
path: root/parallel-checkout.c
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-05-04 16:27:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-05 03:26:36 (GMT)
commit6a7bc9d11823239183dd5f6547b13824a6a15fc2 (patch)
tree0bc96c5f65efb513c8ac0a5f7e614ed647dbf40d /parallel-checkout.c
parentd0e5d357000f44af5ac80f4bab5809d0d8b196d3 (diff)
downloadgit-6a7bc9d11823239183dd5f6547b13824a6a15fc2.zip
git-6a7bc9d11823239183dd5f6547b13824a6a15fc2.tar.gz
git-6a7bc9d11823239183dd5f6547b13824a6a15fc2.tar.bz2
parallel-checkout: add tests related to path collisions
Add tests to confirm that path collisions are properly detected by checkout workers, both to avoid race conditions and to report colliding entries on clone. Co-authored-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parallel-checkout.c')
-rw-r--r--parallel-checkout.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/parallel-checkout.c b/parallel-checkout.c
index 09e8b10..6fb3f1e 100644
--- a/parallel-checkout.c
+++ b/parallel-checkout.c
@@ -8,6 +8,7 @@
#include "sigchain.h"
#include "streaming.h"
#include "thread-utils.h"
+#include "trace2.h"
struct pc_worker {
struct child_process cp;
@@ -326,6 +327,7 @@ void write_pc_item(struct parallel_checkout_item *pc_item,
if (dir_sep && !has_dirs_only_path(path.buf, dir_sep - path.buf,
state->base_dir_len)) {
pc_item->status = PC_ITEM_COLLIDED;
+ trace2_data_string("pcheckout", NULL, "collision/dirname", path.buf);
goto out;
}
@@ -341,6 +343,8 @@ void write_pc_item(struct parallel_checkout_item *pc_item,
* call should have already caught these cases.
*/
pc_item->status = PC_ITEM_COLLIDED;
+ trace2_data_string("pcheckout", NULL,
+ "collision/basename", path.buf);
} else {
error_errno("failed to open file '%s'", path.buf);
pc_item->status = PC_ITEM_FAILED;