Fix potential error when REPOS is a relative dir