OPTIMISTS reckon that India's trajectory is self-correcting. Its messy democracy may not give it the sense of purpose that China's one-party state does. But if the economy gets wobbly enough, the politicians will eventually react, pushing through painful reforms that will keep India's miracle intact. That cheery logic is being put to the test this week, as a proposal to let foreign supermarkets into the country has provoked an almighty row. The government must hold its nerve, for what is at stake is not just where India buys its onions, but whether it is able to make hard choices.

The opening, announced on November 24th, is only partial. Multi-brand foreign chains, such as Walmart and Tesco, must operate as joint ventures, of which they may now own up to 51%, and may operate only in cities of 1m people or more. But this should still shake things up. Indian retailing is backward. Stores are tiny. Supply chains are rickety and shockingly wasteful. Perhaps a third of vegetables rot before reaching a plate. Foreign firms will make life harder for small shopkeepers and middle men. But their cash and know-how could help modernise Indian farming and move crops faster from fields to shopping baskets. That would curb food prices, benefiting the poor and easing India's stubborn inflation (see article).

The new reform is timely. Growth has dipped below 7%. The rupee is weak, investors are nervous and business folk are livid about red tape. India's troubles do not compare with the crisis of 1991, which spurred it to liberalise after decades of stagnation. But still, the government needs to lift confidence, and retail liberalisation could work like a bargain bag of yeast.

Yet the political reaction has been furious and xenophobic. A party boss in Uttar Pradesh, India's most populous state, has promised to defend small shopkeepers by torching Walmart stores. Perhaps half of India's states say they will refuse to implement the reform, as is their right. Trade unions have promised strikes. Parliament has been shouted to a standstill. Already there is talk that the government might back down.

All lost in the supermarket?

A chunk of the blame lies with the main opposition party, the BJP. A decade ago it favoured economic opening, even of retailing, and celebrated India's capitalist boom. Now it is a shoddy outfit, blocking change purely to weaken the government and discounting the national interest with even more zeal than the Beast of Bentonville discounts tomatoes.

But this is also a mess of the government's making. A coalition dominated by the Congress party, it is led by Manmohan Singh, who serves as prime minister by approval of Sonia Gandhi, Congress's hereditary chief. He is a technocrat who helped pass the reforms of the 1990s. But for the past few years Mr Singh's administration has seemed exhausted. The complacent belief that a double-digit growth rate is India's birthright appears to have taken hold. Had the government consistently made the case for reform—and acted boldly on issues from land reform to subsidies—it might not be so bullied today.

But now that it is, it must fight its corner. The retailing reform does not require parliamentary approval. The government should refuse to back down, and argue, loudly and often, that it stands with shoppers, not with the middle men and shopkeepers who serve them so poorly. India's future as an open, competitive economy will not be decided in the supermarket aisles. But this is an important battle nonetheless.