Avoid NPE when the default branch cannot be identified

This is a normal condition that complicates debugging, i.e.
when catching all NPE's.
Don't crash with an NPE when the cache contains removed repositoried
Merge pull request #117 from robinrosenberg/master

NPE fix in default branch determination & NPE fix when commit cache contains removed repo