fix setting repositorypath when --prefix is set + unit test to check on it