datalad_next.runners.call_git_lines

datalad_next.runners.call_git_lines(args: list[str], *, cwd: Path | None = None, input: str | None = None, force_c_locale: bool = False) list[str][source]

Call Git for any (small) number of lines of output

args is a list of arguments for the Git command. This list must not contain the Git executable itself. It will be prepended (unconditionally) to the arguments before passing them on.

If cwd is not None, the function changes the working directory to cwd before executing the command.

If input is not None, the argument becomes the subprocess’s stdin. This is intended for small-scale inputs. For call that require processing large inputs, iter_git_subproc() is to be preferred.

If force_c_locale is True the environment of the Git process is altered to ensure output according to the C locale. This is useful when output has to be processed in a locale invariant fashion.

Raises:

CommandError if the call exits with a non-zero status. --