소스 검색

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 년 전
부모
커밋
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:
         if self._closed:
             return
             return
+        self._file.flush()
         os.fsync(self._file.fileno())
         os.fsync(self._file.fileno())
         self._file.close()
         self._file.close()
         try:
         try: