From 5ac93b1d7e0694ceb303ee72c312921a9b1588f4 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 19 Feb 2015 16:56:13 +0100 Subject: Use uuid instead of tempfile.mkdtmp, which created an actual directory. That, over time, could have caused slow downs due to file-system hassle. Fixes #258 --- git/objects/submodule/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/objects/submodule/base.py') diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index be243acc..82c465ac 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -37,7 +37,7 @@ import git import os import logging -import tempfile +import uuid __all__ = ["Submodule", "UpdateProgress"] @@ -992,7 +992,7 @@ class Submodule(util.IndexObject, Iterable, Traversable): source_dir = mod.git_dir # Let's be sure the submodule name is not so obviously tied to a directory if destination_module_abspath.startswith(mod.git_dir): - tmp_dir = self._module_abspath(self.repo, self.path, os.path.basename(tempfile.mkdtemp())) + tmp_dir = self._module_abspath(self.repo, self.path, str(uuid.uuid4())) os.renames(source_dir, tmp_dir) source_dir = tmp_dir # end handle self-containment -- cgit v1.2.1