We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d12fdca commit 64fc749Copy full SHA for 64fc749
git/cmd.py
@@ -100,16 +100,16 @@ def _parse_lines_from_buffer(buf):
100
# end
101
102
def _read_lines_from_fno(fno, last_buf_list):
103
- buf = os.read(fno, mmap.PAGESIZE)
104
- buf = last_buf_list[0] + buf
+ for buf in iter(lambda: os.read(fno, mmap.PAGESIZE), b''):
+ buf = last_buf_list[0] + buf
105
106
- bi = 0
107
- for bi, line in _parse_lines_from_buffer(buf):
108
- yield line
109
- # for each line to parse from the buffer
+ bi = 0
+ for bi, line in _parse_lines_from_buffer(buf):
+ yield line
+ # for each line to parse from the buffer
110
111
- # keep remainder
112
- last_buf_list[0] = buf[bi:]
+ # keep remainder
+ last_buf_list[0] = buf[bi:]
113
114
def _dispatch_single_line(line, handler):
115
line = line.decode(defenc)
0 commit comments