Correctly extract name of git directory to cd to