Ensure correct git directory setup when -h is passed with commands. This
specifically applies to repos with special help text configuration
variables and to commands run with -h outside a repository. This
will also protect against test failures in the upcoming change to BUG in
prepare_repo_settings if no git directory exists.
Note: this diff is better seen when ignoring whitespace changes.
Co-authored-by: Junio C Hamano <redacted> Signed-off-by: Lessley Dennington <redacted> Reviewed-by: Elijah Newren <redacted> Signed-off-by: Junio C Hamano <redacted>