|
50 | 50 | stream_copy
|
51 | 51 | )
|
52 | 52 |
|
53 | | -from gitdb.utils.compat import MAXSIZE |
54 | 53 | from gitdb.utils.encoding import force_bytes
|
55 | 54 |
|
56 | 55 | import tempfile
|
57 | 56 | import os
|
| 57 | +import sys |
58 | 58 |
|
59 | 59 |
|
60 | 60 | __all__ = ('LooseObjectDB', )
|
@@ -196,7 +196,7 @@ def store(self, istream):
|
196 | 196 | if istream.binsha is not None:
|
197 | 197 | # copy as much as possible, the actual uncompressed item size might
|
198 | 198 | # be smaller than the compressed version
|
199 | | - stream_copy(istream.read, writer.write, MAXSIZE, self.stream_chunk_size) |
| 199 | + stream_copy(istream.read, writer.write, sys.maxsize, self.stream_chunk_size) |
200 | 200 | else:
|
201 | 201 | # write object with header, we have to make a new one
|
202 | 202 | write_object(istream.type, istream.size, istream.read, writer.write,
|
@@ -225,16 +225,12 @@ def store(self, istream):
|
225 | 225 | if not isdir(obj_dir):
|
226 | 226 | mkdir(obj_dir)
|
227 | 227 | # END handle destination directory
|
228 | | - # rename onto existing doesn't work on windows |
229 | | - if os.name == 'nt': |
230 | | - if isfile(obj_path): |
231 | | - remove(tmp_path) |
232 | | - else: |
233 | | - rename(tmp_path, obj_path) |
234 | | - # end rename only if needed |
| 228 | + # rename onto existing doesn't work on NTFS |
| 229 | + if isfile(obj_path): |
| 230 | + remove(tmp_path) |
235 | 231 | else:
|
236 | 232 | rename(tmp_path, obj_path)
|
237 | | - # END handle win32 |
| 233 | + # end rename only if needed |
238 | 234 |
|
239 | 235 | # make sure its readable for all ! It started out as rw-- tmp file
|
240 | 236 | # but needs to be rwrr
|
|
0 commit comments