datalad_next.runners.call_git_oneline

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

Call Git for a single line of output

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. --

  • AssertionError if there is more than one line of output. --