The Giants struggled generating offense for most of the day, but right-hander Jeff Samardzija kept them within striking distance. They finally rewarded their starting pitcher by erasing a two-run deficit in the seventh en route to a 5-3 win over the Pirates on Sunday at PNC Park, completing San Francisco's second straight three-game series sweep.