Proper up-to-date-check; fix when branches are empty.