git_interface.helpers

Methods not related to git commands, but to help the program function

async git_interface.helpers.chunk_yielder(input_stream)

reads from a stream chunk by chunk until EOF. Uses DEFAULT_BUFFER_SIZE to determine max chunk size

param input_stream

The stream to read

yield

Each chunk

Parameters

input_stream (StreamReader) –

Return type

AsyncGenerator[bytes, None]

git_interface.helpers.ensure_path(path_or_str)

Ensures that given value is a pathlib.Path object.

param path_or_str

Either a path string or pathlib.Path obj

return

The value as a pathlib.Path obj

Parameters

path_or_str (Union[Path, str]) –

Return type

Path

async git_interface.helpers.subprocess_run(args, **kwargs)

Asynchronous alternative to using subprocess.run

param args

The arguments to run (len must be at least 1)

return

The completed process

Parameters

args (Iterable[str]) –

Return type

Coroutine[Any, Any, CompletedProcess]

async git_interface.helpers.subprocess_run_buffered(args)

Asynchronous alternative to using subprocess.Popen using buffered reading

param args

The arguments to run (len must be at least 1)

raises BufferedProcessError

Raised a non-zero return code is provided

yield

Each read content section

Parameters

args (Iterable[str]) –

Return type

AsyncGenerator[bytes, None]