git.samba.org
/
jelmer
/
dulwich-libgit2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd7e0c4
)
use fstat if possible.
author
Jelmer Vernooij
<jelmer@samba.org>
Fri, 12 Feb 2010 02:36:16 +0000
(
03:36
+0100)
committer
Jelmer Vernooij
<jelmer@samba.org>
Fri, 12 Feb 2010 02:36:16 +0000
(
03:36
+0100)
dulwich/pack.py
patch
|
blob
|
history
diff --git
a/dulwich/pack.py
b/dulwich/pack.py
index 966ec82e12b5e52628b1489c6bf2f1a80a8ebc38..9d96a3849e9dc755385cbc903be32709293d57c8 100644
(file)
--- a/
dulwich/pack.py
+++ b/
dulwich/pack.py
@@
-207,11
+207,12
@@
class PackIndex(object):
self._file = file
fileno = getattr(self._file, 'fileno', None)
if fileno is not None:
+ fd = self._file.fileno()
if size is None:
- self._size = os.
path.getsize(filename)
+ self._size = os.
fstat(fd).st_size
else:
self._size = size
- self._contents = mmap.mmap(
self._file.fileno()
, self._size,
+ self._contents = mmap.mmap(
fd
, self._size,
access=mmap.ACCESS_READ)
else:
self._file.seek(0)