The New Brunswick government is ending a two-year fight with CUPE and repealing legislation that would have forced five unions into a shared-risk pension plan.