=== modified file 'bzrlib/transport/sftp.py'
Index: unstable/bzrlib/transport/sftp.py
===================================================================
--- unstable.orig/bzrlib/transport/sftp.py
+++ unstable/bzrlib/transport/sftp.py
@@ -410,8 +410,9 @@ class SFTPTransport(ConnectedTransport):
         try:
             path = self._remote_path(relpath)
             f = self._get_sftp().file(path, mode='rb')
+            size = f.stat().st_size
             if self._do_prefetch and (getattr(f, 'prefetch', None) is not None):
-                f.prefetch()
+                f.prefetch(size)
             return f
         except (IOError, paramiko.SSHException), e:
             self._translate_io_exception(e, path, ': error retrieving',
