Added logging when no branch is found.

It's thrown from time to time with no visible reason.