Fix function that gets the git directory

Change-Id: I05d73eb05a7007ae891c90f12a5bdfa8362643ef