Add git-directory function.