Fix getting git root from subdirectory