summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2015-09-12 22:40:08 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2015-09-12 22:40:08 +0000
commit4d8f6d473b459970dead66d506a97fd66656dfb0 (patch)
tree4060318bd2e6b703f70454dab857721203065668
parente925efa9bfffe0e61a7dce35fa9a0b9329ba65aa (diff)
downloadybd-make-git-clones-atomic.tar.gz
Allow parallel gitdir attemptsmake-git-clones-atomic
-rw-r--r--repos.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/repos.py b/repos.py
index cc57616..c41b05c 100644
--- a/repos.py
+++ b/repos.py
@@ -26,6 +26,7 @@ import requests
import app
import utils
+import tempfile
if sys.version_info.major == 2:
@@ -107,10 +108,8 @@ def get_tree(this):
def mirror(name, repo):
- gitdir = os.path.join(app.config['gits'], get_repo_name(repo))
- tmpdir = gitdir + '.tmp'
- if os.path.isdir(tmpdir):
- shutil.rmtree(tmpdir)
+ tempfile.tempdir = app.config['tmp']
+ tmpdir = tempfile.mkdtemp()
repo_url = get_repo_url(repo)
try:
os.makedirs(tmpdir)