Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ac93b1

Browse files
committed
Use uuid instead of tempfile.mkdtmp, which created an actual directory.
That, over time, could have caused slow downs due to file-system hassle.Fixesgitpython-developers#258
1 parentf51fe3e commit5ac93b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎git/objects/submodule/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
importos
3939
importlogging
40-
importtempfile
40+
importuuid
4141

4242
__all__= ["Submodule","UpdateProgress"]
4343

@@ -992,7 +992,7 @@ def rename(self, new_name):
992992
source_dir=mod.git_dir
993993
# Let's be sure the submodule name is not so obviously tied to a directory
994994
ifdestination_module_abspath.startswith(mod.git_dir):
995-
tmp_dir=self._module_abspath(self.repo,self.path,os.path.basename(tempfile.mkdtemp()))
995+
tmp_dir=self._module_abspath(self.repo,self.path,str(uuid.uuid4()))
996996
os.renames(source_dir,tmp_dir)
997997
source_dir=tmp_dir
998998
# end handle self-containment

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp