Truncate directories to shortest unique substring.