As for the claim, “He has committed himself to divorce upon fulfilment of the condition, so it is binding upon him,” this is invalid for several reasons.
First, someone who swears an oath invoking unbelief or Islam—for example, by saying, “If I do such-and-such, I am a Jew or a Christian,” or, in the case of a non-Muslim under Muslim protection, “If I do such-and-such, I am a Muslim”—has committed himself to unbelief or Islam upon fulfilment of the condition. Yet, by consensus, neither consequence follows, because he did not intend it to occur when the condition was fulfilled; rather, he intended to swear an oath by it. This same consideration applies to all other kinds of oaths expressed in conditional form.
Second, if he says, “If I do such-and-such, I must divorce my wife,” then, by consensus, he is not obliged to divorce her if he does that act.
Third, when someone commits himself to something upon fulfilment of a condition, it becomes binding upon him only if two requirements are met: first, what he undertakes must be an act of devotion; and second, his intention must be to draw closer to Allah through it, not to swear an oath by it. Thus, if he undertakes something that is not an act of devotion, such as divorcing, selling, leasing, eating or drinking, it does not become binding upon him.
Likewise, if he undertakes an act of devotion, such as prayer, fasting or Hajj, by way of swearing an oath, it does not become binding upon him. Rather, expiation for an oath suffices, according to the Companions and the majority of the early Muslims. This is the position of al-Shāfi'ī and Ahmad, the later of the two opinions reported from Abū Hanīfa, and the view of the discerning scholars among Mālik’s followers.