What if you first attempted rebases of your branches? Then you would detect empty branches