diff options
Diffstat (limited to 'lib/git/utils.py')
-rw-r--r-- | lib/git/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/git/utils.py b/lib/git/utils.py index dd1117b6..f188a7a4 100644 --- a/lib/git/utils.py +++ b/lib/git/utils.py @@ -205,7 +205,10 @@ class ConcurrentWriteOperation(LockFile): if successful: # on windows, rename does not silently overwrite the existing one if sys.platform == "win32": - os.remove(self._file_path) + if os.path.isfile(self._file_path): + os.remove(self._file_path) + # END remove if exists + # END win32 special handling os.rename(self._temp_write_fp.name, self._file_path) else: # just delete the file so far, we failed |