rev-list: handle missing tree objects properly