If you `git rebase --exec 'gulp runtests-parallel --runners user'` this
project, the tests perform Git operations on various subprojects [1],
but because Git exports `GIT_DIR` and `GIT_WORK_TREE`, they end up
operating on the parent project instead.
Adding `--git-dir` and `--work-tree` overrides `GIT_DIR` and
`GIT_WORK_TREE` [2], forcing the tests to operate on the correct
repositories, however `clone` ignores `--git-dir`:
git init repository
git --git-dir git-dir clone repository directory
I'd expect Git to create a directory `git-dir` and put the index, etc.
there, but instead it creates `directory/.git`, as usual. I'm not sure
if this is a bug or the expected behavior?
[1]
https://github.com/microsoft/TypeScript/blob/master/src/testRunner/externalCompileRunner.ts#L58
[2] https://github.com/microsoft/TypeScript/pull/35362