fix clear-locals when branch is also a path