diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-02-19 16:56:13 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-02-19 16:56:13 +0100 |
commit | 5ac93b1d7e0694ceb303ee72c312921a9b1588f4 (patch) | |
tree | 1d719956fb1af36e50d6f4fd6afd9bf290612bd8 /git/objects/submodule/base.py | |
parent | f51fe3e66d358e997f4af4e91a894a635f7cb601 (diff) | |
download | gitpython-5ac93b1d7e0694ceb303ee72c312921a9b1588f4.tar.gz |
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
Diffstat (limited to 'git/objects/submodule/base.py')
-rw-r--r-- | git/objects/submodule/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 |