2
0
Эх сурвалжийг харах

Added flush before fsync

Improves file system integrity.
Without fsync when the system (Windows) is not shutdown properly, files may have proper length but contain only '0' bytes.
wernha 2 жил өмнө
parent
commit
3975aff727
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      dulwich/file.py

+ 1 - 0
dulwich/file.py

@@ -189,6 +189,7 @@ class _GitFile(object):
         """
         if self._closed:
             return
+        self._file.flush()
         os.fsync(self._file.fileno())
         self._file.close()
         try: