At the level of state philosophy, if there is such a thing, India has been a country represented - always - by a philosophy of strategic restraint.
This philosophy insists that it is not in Indian culture or heritage to be an aggressor nation. It is natural that during a very long and poorly recorded history, there will be many examples that may be selected to prove that this was so.
There may be as many examples to prove the contrary. for instance, the Magadhan Empire had bitten deep into the Seleukian successor kingdom to the empire left by Alexander III of Macedon,the Great; the Chola kings of the southern Coromandel coast reinforced existing Tamil settlements in Sri Lanka and consolidated them into an empire of its own; the Cholas went on to influence and even dominate politically large tracts of south east Asia; the Mughals ruled over large parts of Afghanistan; the Maratha admirals dominated the Indian Ocean in their time; the Sikhs penetrated into Afghanistan and into Tibet; and the Gurkha kingdom penetrated into Tibet.
Even a simple glance at these episodes will bear out the evidence of strategic restraint. Indian monarchs were not really oriented to conquests overseas.
British colonial rule was a significant deviation. It is not surprising that the British, being an expansionary power, saw no cultural or legacy related constraint on their actions. They expanded from their Indian base in every direction: into Sri Lanka, to Aden, to the Gulf states, to Afghanistan, to Tibet, to Burma, to the Straits of Malacca, indeed, to China itself. This was significant because it left India, at independence, with contradictions in its policies.
While the cultural constraint was a powerful influence, it was traditional to hold what a state had. The Indian state had boundaries which were never well defined, with the Ottoman Empire in the Gulf, with Afghanistan, with Tibet or even with Burma. In fact, even while both Sri Lanka and India were under common administrative control, there were anomalies - the island of Kachchateevu, for instance - that caused problems.
These boundary issues were divided with the progressive departure of the British. Kuwait inherited - was itself - the boundary issue with the Mesopotamian province; Pakistan got Gwadar and the Afghan border; India got the Tibetan, Burmese and Sri Lankan borders.
This messy situation with the borders prevented India from reverting to its traditional posture of strategic restraint until the blood-letting of the 1962 border conflict with China. That was the last occasion on which the Indian state found itself at war over boundaries. And the result of that conflict firmly reinforced the tendency to observe strategic restraint.
On subsequent occasions, in 1965, in 1971, in 2002, and on all occasions on the border with China, India observed strategic restraint.
From the point of view of the philosophy guiding Indian foreign relations therefore, it is unlikely that India will take sides against China under any circumstances. There can be dramatic exceptions, linked to an outrage perpetrated by China, but there is no possibility of violence under normal circumstances.