Wilson Ramos had one of Washington’s two hits against Madison Bumgarner, but a big catch by Ben Revere and quality pitching made the solo home run stand up. (Nick Wass/Associated Press)

At 21 games over .500, with an almost-comfortable lead in the National League East, these Washington Nationals should not be scolded for considering what may come their way in October.

Their manager, Dusty Baker, mentioned playoff positioning at the outset of this weekend’s series, which would determine the tiebreaker between the Nationals and San Francisco Giants. The tried-and-true blueprints for deep playoff runs dictate teams plan ahead without looking ahead, see the future without overlooking the present. So it is for these Nationals.

Games like Sunday’s 1-0 win at Nationals Park might loom somewhere on a cooler autumn horizon, one of those pitchers’ duels in which one pitch can change everything, in which pivot points pop up regularly, in which the little things become the decisive ones.

Madison Bumgarner and Tanner Roark threw scoreless inning after scoreless inning. Ben Revere made a game- saving catch. Wilson Ramos hit a go-ahead home run in the seventh. The back end of the Nationals’ bullpen was tested with a one-run lead. In a game that gave them a regular season series win over an annual title contender, the Nationals met the challenge — despite having fewer hits (two) than they have ever had in a win since moving to D.C.

“That’s big. That’s real big. We knew that coming into this game,” Baker said. “. . . We lost the season series to the Dodgers and to the Cubs. We really needed this one because we could very well see San Francisco again.”

Baker has said Roark would be his third starter if the playoffs started soon, and the right-hander has continually shown the grit of a pitcher compensating for lackluster stuff. But Roark does not have lackluster stuff, and so he is both willing and able to barrel his way through jams rather than tiptoe hopefully through them.

Case in point: when he got in a two-on, two-out jam facing Giants No. 3 hitter Brandon Belt in the third inning, Roark threw a four-seam fastball on the inside corner. Belt stood and watched strike three. Roark escaped trouble because his fastball is good enough to challenge hitters, and he is willing to use it that way.

“I didn’t want to get beat with my best stuff,” Roark said. “I wanted to throw the right pitch and be aggressive in the zone, not be afraid of giving up a hit or walking somebody.”

Four times, Roark found himself with two men on. Four times, he escaped with no men scoring. That evasion became increasingly important because the Nationals did not have a hit against Bumgarner until the fourth inning.

The lefty, whom the Nationals missed last weekend in San Francisco, allowed one base runner through the first 3⅔ innings — a four-pitch walk to Jayson Werth in the first that extended Werth’s on-base streak to 38 games. No one in the majors has had a longer one this season.

Anthony Rendon doubled to right-center with two outs in the fourth to break up the no-hitter.

Roark maneuvered through a scoreless outing into the seventh, where he fell into another first-and-third jam — in part because Daniel Murphy misplayed a groundball that would have ended the inning. With no one warming in the bullpen, Belt came up again.

This time, he beat Roark. He drove a ball to deepest center field where Revere pursued it with a twist one way, then another. Revere has not been the hitter the Nationals hoped this season, lost the leadoff spot, then playing time in center field. But when he caught Belt’s drive — like Willie Mays, Baker said later — Belt slammed his helmet in frustration, and the crowd erupted in relieved glee.

“I didn’t even see it. But then I saw Ben racing backwards, and I’m like, ‘Oh, man. Come on,’ ” Roark said. “And then he made that over-the-shoulder catch. It was a heck of a play. Unbelievable.”

Roark’s day ended at seven innings, five hits, five strikeouts and 105 pitches. He has made two starts against the Giants in the past 10 days. In 14 innings, he has allowed one earned run. Sunday was his seventh start of the season of at least seven innings and no earned runs, most in the majors this season.

“I think of him [as one of the best in baseball],” Ramos said. “He’s done a very good job. Unfortunately, there are a lot of names ahead of him, and it shouldn’t be that way, in my personal opinion.”

A few moments after Revere’s catch, Ramos led off the bottom of the seventh with his 18th home run of the season, a high flyball to right-center that was the Nationals’ second hit of the afternoon.

“His confidence level is high. It’s real high. And he can reach the fences at any part of the ballpark, but he remains within himself and not trying to hit home runs all the time,” Baker said. “. . . I love it when he does because he has one of the premier home run trots in baseball.”

Bumgarner went the full eight innings and did not allow another hit. The homer gave the Nationals the kind of 1-0 lead they built — and rebuilt — their bullpen to hold when it matters most.

Shawn Kelley pitched a perfect eighth inning, culminating with a strikeout of Saturday’s star, Eduardo Nunez. That set up Mark Melancon’s first save opportunity as a National. He worked a 1-2-3 ninth and struck out Hunter Pence to end it, his 31st save of the season overall.

“Melancon was such a great pickup. I was really excited when I heard the news about him coming over because you saw how nasty he was in the ninth inning,” Revere said. “Definitely needed that.”

The Nationals’ new closer held the kind of lead they have struggled to hold, against the kind of team that has beaten them when it counts — the kind of lead, against the kind of team, they may encounter a couple months from now.