Skip to content

Commit 1303aa5

Browse files
author
Mario Flach
committed
Fix stream bug in GitRekt.GitAgent
When stream_chunk_size: :infinity is given, we enumerate the stream with Enum.to_list/1 instead of returning an asynchronous GitRekt.GitStream.
1 parent 649c506 commit 1303aa5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/gitrekt/lib/gitrekt/git_agent.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,9 @@ defmodule GitRekt.GitAgent do
10671067
telemetry(:execute, op, fn ->
10681068
case call(handle, op) do
10691069
{:ok, stream} ->
1070-
{:ok, async_stream(op, stream, chunk_size, pid)}
1070+
if chunk_size == :infinity,
1071+
do: {:ok, Enum.to_list(stream)},
1072+
else: {:ok, async_stream(op, stream, chunk_size, pid)}
10711073
{:error, reason} ->
10721074
{:error, reason}
10731075
end

0 commit comments

Comments
 (0)