Fix a bug where test-autopatch would fail in an env where no global git config is set
Summary: See title.
Test Plan:
In environments with and without global git config set:
ninja check-source-control-tools
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D4635