Fixed bug/bad implementation of git dir retrieval code