Avoid crashes when switching branches
See comments in diff. Relaxed the assert a bit: only assert when we hit
an exact match. This code path will no longer trigger a crash in release
mode now either. If I did something wrong, some projects just don't get
a proper VCS info attached to their names (which is way better than
crashing).
BUG: 365884
FIXED-IN: 5.0.1