diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2019-09-28 13:18:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-28 13:18:05 +0200 |
| commit | cd79e2ac4d1f7fdf8b566edc5c4388876434594d (patch) | |
| tree | c311a1384675c191e171f8dc016387ba4c97f024 /gitdb | |
| parent | e8e009d1b4b860b42083132bd7722c2802e5e5d4 (diff) | |
| parent | 79b705f061b51dc151a00729b722fbdebde59f5c (diff) | |
| download | gitdb-cd79e2ac4d1f7fdf8b566edc5c4388876434594d.tar.gz | |
Merge pull request #52 from efiop/master
loose: rename only if needed
Diffstat (limited to 'gitdb')
| -rw-r--r-- | gitdb/db/loose.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gitdb/db/loose.py b/gitdb/db/loose.py index 192c524..53ade9f 100644 --- a/gitdb/db/loose.py +++ b/gitdb/db/loose.py @@ -225,16 +225,12 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW): if not isdir(obj_dir): mkdir(obj_dir) # END handle destination directory - # rename onto existing doesn't work on windows - if os.name == 'nt': - if isfile(obj_path): - remove(tmp_path) - else: - rename(tmp_path, obj_path) - # end rename only if needed + # rename onto existing doesn't work on NTFS + if isfile(obj_path): + remove(tmp_path) else: rename(tmp_path, obj_path) - # END handle win32 + # end rename only if needed # make sure its readable for all ! It started out as rw-- tmp file # but needs to be rwrr |
