diff options
Diffstat (limited to 'lib/git')
-rw-r--r-- | lib/git/cmd.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/git/cmd.py b/lib/git/cmd.py index cef4ea60..aaa27adc 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -130,8 +130,13 @@ class Git(object): if self._nbr == self._size: return '' + # clamp size to lowest allowed value + bytes_left = self._size - self._nbr if size > -1: - size = min(self._size - self._nbr, size) + size = min(bytes_left, size) + else: + size = bytes_left + # END handle size data = self._stream.readline(size) self._nbr += len(data) |