Update GitClient to use run_process().

Review Request #12661 — Created Sept. 30, 2022 and submitted — Latest diff uploaded

Information

RBTools
release-4.x

Reviewers

This switches GitClient to use run_process() instead of the legacy
execute(). This ensures that every call site is deliberate in the
kinds of data it's expected to work with and how errors are handled.

The call sites have been audited to ensure that we're only redirecting
stderr to stdout when we should and that we're explicitly handling error
conditions. This may not be perfect, but it's already fixed up a few
places where we may have been doing things wrong before.

All git config calls are now handled by a _get_git_config(), which
offers a standardized way of fetching configuration data, returning the
string if found, None if not found, or raising SCMError if we get a
fatal: result (such as if running outside of a Git tree).

Unit tests pass.

Posted this change for review.

Commits

Files

    Loading...