The House and Senate passed legislation Thursday to fund the government through December 22, removing the threat of a disruption to federal agencies for two weeks while Republican and Democratic leaders work to resolve a tough set of policy differences that would allow them to pass a long-term spending bill.