Skip to content

Commit 42e7e2a

Browse files
peffgitster
authored andcommitted
read_istream_filtered: propagate read error from upstream
The filter istream pulls data from an "upstream" stream, running it through a filter function. However, we did not properly notice when the upstream filter yielded an error, and just returned what we had read. Instead, we should propagate the error. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f54fac5 commit 42e7e2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

streaming.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static read_method_decl(filtered)
237237
if (!fs->input_finished) {
238238
fs->i_end = read_istream(fs->upstream, fs->ibuf, FILTER_BUFFER);
239239
if (fs->i_end < 0)
240-
break;
240+
return -1;
241241
if (fs->i_end)
242242
continue;
243243
}

0 commit comments

Comments
 (0)