Deduce the repository root directory for a given file