SAN FRANCISCO -- Yusmeiro Petit enjoys doing nothing. It allows him to be at his best when he is asked to do something.

The Giants right-hander got the call Tuesday night about an hour before game time, and he responded with six shutout innings in an emergency start, propelling San Francisco to a 6-0 victory over the San Diego Padres.

In evening the three-game series at a win apiece, the Giants had to change pitchers unexpectedly when scheduled starter Matt Cain cut the tip of his right index finger on a knife while preparing a pregame meal in the clubhouse.

No stitches were required, but Cain was forced to miss the start, prompting Giants manager Bruce Bochy to call upon Petit (2-1). The 29-year-old long reliever had not pitched since a four-inning stint in Colorado on April 21.

Petit literally hadn't pitched in eight days. No warmups. No simulated games. Not even a game of catch with one of the Giants' catchers.

"I have to be ready every day," Petit said about the inconsistent nature of his job. "I don't want to throw (in the bullpen) and then not be ready (for a lengthy stint the next day)."

The well-rested Petit was near perfect for six innings against a Padres lineup missing second baseman Jedd Gyorko (paternity leave), third baseman Chase Headley (strained right calf), center fielder Carlos Quentin (bruised left knee) and left fielder Seth Smith (strained right groin).

After retiring the first nine batters in order, Petit allowed fourth-inning singles to shortstop Everth Cabrera and left fielder Chris Denorfia that sandwiched a double-play grounder. He also allowed a sixth-inning double by Padres reliever Donn Roach.

However, only one baserunner reached second base, and Petit did not help the Padres' cause with any walks. He struck out four in easily his longest outing of the season.

"He's an asset for us," Cain said of Petit. "When you have a guy like that in your bullpen, that's really an asset. Obviously today he's able to pick us up for six innings."

Cain said he dropped a knife while making a sandwich. He instinctually grabbed for the knife as it fell, suffering the cut on his fingertip.

He tried to grip a baseball and even tossed a few after the incident, but he said the cut bled every time he attempted it, so the decision was made to go with Petit.

"That's my job," Petit said of being ready at a moment's notice. "I'm prepared for that all the time."

The Giants gave the reliever-turned-starter plenty of support, with center fielder Angel Pagan and first baseman Buster Posey smacking first-inning home runs off Padres left-hander Eric Stults (1-3), and catcher Hector Sanchez driving in three runs with a single and a sacrifice fly.

Asked if his club was caught off-guard by the late change, Padres manager Bud Black said no.

"I don't think it's tough," he said. "Players are accustomed to adjusting on the fly. We've faced Petit before. Our guys know who the opposing pitchers are."

Right-handers Jean Machi and Santiago Casilla provided three innings of no-hit relief behind Petit, completing the Giants' second shutout of the season.

The Giants out-hit the Padres 9-3, with each of the first seven hitters in the San Francisco lineup contributing at least one hit. Pagan was the only player in the game with two hits.

Roach limited the Giants to one unearned run on two hits in 4 2/3 innings in relief of Stults.

It didn't take long for the Giants to rough up Stults, who allowed only one run in six innings when he beat San Francisco 2-1 in San Diego 10 days earlier. Pagan belted the left-hander's third pitch of the game just inside the left field foul pole for his seventh career leadoff homer, and Posey, batting third, blasted a solo shot into the bleachers in left-center seven pitches later.

It was the Giants' first two-homer first inning at AT&T Park since 2008.

Stults nearly got out of trouble in what turned out to be his final inning, the third, when he got Giants left fielder Michael Morse to ground into a 1-2-3 double play with the bases loaded and no outs.

However, he fell behind in the count 3-0 to Pablo Sandoval, prompting the Padres to intentionally walk the slumping third baseman to reload the bases. Sanchez then delivered two runs with a single to center field, and shortstop Brandon Crawford made it 5-0 with an RBI single to right.

Stults was pulled at that point, having allowed five runs on seven hits in his shortest starting effort in four years. He walked two and struck out one.

Sanchez's third RBI came on a sacrifice fly against Roach that scored pinch runner Juan Perez in the fifth, increasing the San Francisco lead to 6-0.