Skip to content

Commit cd79e2a

Browse files
authored
Merge pull request #52 from efiop/master
loose: rename only if needed
2 parents e8e009d + 79b705f commit cd79e2a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

gitdb/db/loose.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,12 @@ def store(self, istream):
225225
if not isdir(obj_dir):
226226
mkdir(obj_dir)
227227
# END handle destination directory
228-
# rename onto existing doesn't work on windows
229-
if os.name == 'nt':
230-
if isfile(obj_path):
231-
remove(tmp_path)
232-
else:
233-
rename(tmp_path, obj_path)
234-
# end rename only if needed
228+
# rename onto existing doesn't work on NTFS
229+
if isfile(obj_path):
230+
remove(tmp_path)
235231
else:
236232
rename(tmp_path, obj_path)
237-
# END handle win32
233+
# end rename only if needed
238234

239235
# make sure its readable for all ! It started out as rw-- tmp file
240236
# but needs to be rwrr

0 commit comments

Comments
 (0)