Skip to content

Commit bc195fb

Browse files
[Mac OS] PermissionError Fix
1 parent a8c894f commit bc195fb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gitdb/db/loose.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
chmod,
3737
isfile,
3838
remove,
39-
rename,
4039
dirname,
4140
basename,
4241
join
@@ -53,6 +52,7 @@
5352

5453
import tempfile
5554
import os
55+
import shutil
5656
import sys
5757

5858

@@ -225,7 +225,9 @@ def store(self, istream):
225225
if isfile(obj_path):
226226
remove(tmp_path)
227227
else:
228-
rename(tmp_path, obj_path)
228+
shutil.copyfile(tmp_path, obj_path)
229+
remove(tmp_path)
230+
tmp_path = None
229231
# end rename only if needed
230232

231233
# make sure its readable for all ! It started out as rw-- tmp file

0 commit comments

Comments
 (0)