Fix AheadBy/BehindBy behavior for orphaned branch