using PHP's chdir() instead of Git's --git-dir now, seems to work better