We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 788fccc + f4835e4 commit 8092c43Copy full SHA for 8092c43
src/filter.c
@@ -809,6 +809,7 @@ static int proxy_stream_close(git_writestream *s)
809
{
810
struct proxy_stream *proxy_stream = (struct proxy_stream *)s;
811
git_buf *writebuf;
812
+ git_error_state error_state = {0};
813
int error;
814
815
assert(proxy_stream);
@@ -826,6 +827,11 @@ static int proxy_stream_close(git_writestream *s)
826
827
git_buf_sanitize(proxy_stream->output);
828
writebuf = proxy_stream->output;
829
} else {
830
+ /* close stream before erroring out taking care
831
+ * to preserve the original error */
832
+ giterr_state_capture(&error_state, error);
833
+ proxy_stream->target->close(proxy_stream->target);
834
+ giterr_state_restore(&error_state);
835
return error;
836
}
837
0 commit comments