Skip to content
Snippets Groups Projects
Commit 234f1ba1 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

git.py: Handle concurrent download completions properly

Use os.rename() to rename the cloned temporary repository into
place in the source cache, and issue a STATUS message when discarding
a duplicate clone, in the case where the same repository is cloned
twice in parallel.

The problem with using shutil.move() is that it will create the source
directory in a subdirectory of the destination when the destination
exists, so it's behavior depends on whether the destination exists.

This shutil.move() behavior has so far hidden the race condition
where a duplicate repo is created in a subdirectory, as you need
to have three concurrent downloads of the same repo in order to
trigger the error.

This fixes issue #503
parent ef4c6928
No related branches found
No related tags found
Loading
Checking pipeline status