Rather than use `cwd`, use the `--git-dir=` argument.