fix a keyerror in branch lookup for local repos