Wrap git invocations in `with`.
Review Request #14400 — Created April 14, 2025 and submitted — Latest diff uploaded
Running with the latest Python, I was getting warnings about leaked file
descriptors, which were coming fromgitinvocations inside the
GitClient, as it createdBufferedReaderinstances for stdout/stderr.
This change wraps those subprocess invocations inwithblocks, causing
things to get cleaned up appropriately.
Loaded some diffs and no longer saw warnings about leaked resources.