The Indian Penal Code, 1860 is repealed. It was replaced by The Bharatiya Nyaya Sanhita, 2023 from 1 July 2024; this provision still applies to matters that arose before then.
Whoever, except as hereinafter excepted, knowing or having reason to believe that an officer, soldier, [sailor or airman], in the Army, [Navy or Air Force] of the [Government of India], has deserted, harbours such officer, soldier, [sailor or airman], shall be punished with imprisonment of either description for a term which may extend to two years, or with fine or with both.
Exception.—This provision does not extend to the case in which the harbour is given by a wife to her husband.