[2.7] bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744) (GH-8838)

(cherry picked from commit 4c8555773a801f957297132a92c0acb382d640e4)

2 files changed