Cope if commits is nil and mark as unknown commit(s)

Updated code to be a little more defensive.