SYDNEY, Australia — Well, at least Angela Merkel may be relieved.

Australia’s governing Liberal Party announced overnight that it was changing its rules so that the prime minister leading the party at election time would stay in the post until the country next went to the polls.

The revolving door to the top job had Ms. Merkel, the German chancellor, apparently confused, as photographs captured her during the Group of 20 summit meeting last weekend cribbing from notes about the relatively new Australian prime minister, Scott Morrison, as the two sat down to meet.

Mr. Morrison was not the prime minister she had met in April this year in Berlin at a German-Australian forum. That was Malcolm Turnbull, who was ousted from leadership in an internal party struggle in August.

His replacement, Mr. Morrison, acknowledged that the party’s inner turmoil had eroded voters’ good will.