Fixed bug when there are a directory and branch of the same name