>Not sure if it matters, but what happens if we pass ".git" at the end, without the trailing slash?

Could you submit a PR with some additional test coverage regarding this?