Putting the Giants' recent struggles and Madison Bumgarner's success in perspective:

San Francisco has won all of six times in its past 21 games - and four of those wins belong to Bumgarner.

He held the Dodgers to two runs on three hits in seven innings, and the Giants ended their losing streak at four games with a 4-2 victory in China Basin on Saturday.

Bumgarner (9-5), named to the NL All-Star team, struck out nine - including Yasiel Puig three times - and did not issue a walk.

Said second baseman Marco Scutaro of the 23-year-old left-hander: "He's a great pitcher, especially at his age. He knows how to make adjustments. He knows how to attack hitters."

Bumgarner retired the first 14 Dodgers before Andre Ethier's bloop single in the fifth. Many pitchers profess that they're not aware of a possible no-hitter as it progresses. Bumgarner is not one of those pitchers.

"I'm always thinking about it until I'm not," Bumgarner said. "Then, you're thinking about the shutout until you don't have that, and then you're thinking about just keeping them wherever they're at."

The Dodgers were down 4-0 when Ethier became their first baserunner. The next batter, Tim Federowicz, took Bumgarner deep to left. That ended the shutout bid, but L.A. would not score again.