I came to the Messenger of Allah ﷺ with a group of the Ashariyyin asking him to provide us with mounts. He said, "By Allah, I will not give you mounts, and I do not have anything to mount you on."We waited as long as Allah willed, then he ordered three excellent camels with white humps to be given to us. When we set off, some of us said to others, "We came to the Messenger of Allah ﷺ asking him for mounts, and he swore that he would not give us mounts. Let us go back so we can remind him."So we came to him and said, "Messenger of Allah, we came to you asking for mounts, and you swore you would not give us mounts, then you gave us mounts."He said, "It was not I who mounted you. Rather, Allah mounted you. By Allah, if Allah Most High wills, I never take an oath and then see something better than it without doing what is better and making expiation for my oath," or he said, "without making expiation for my oath and doing what is better."
حدثنا سليمان بن حرب حدثنا حماد بن زيد حدثني غيلان بن جرير
أتيت رسول الله ﷺ في رهط من الأشعريين نستحمله فقال لا والله ما أحملكم وما عندي ما أحملكم عليه فلبثنا ما شاء الله ثم أمر لنا بثلاث ذود غر الذرى فلما انطلقنا قال بعضنا لبعض أتينا رسول الله ﷺ نستحمله فحلف أن لا يحملنا ارجعوا بنا أي حتى نذكره قال فأتيناه فقلنا يا رسول الله إنا أتيناك نستحملك فحلفت أن لا تحملنا ثم حملتنا فقال ما أنا حملتكم بل الله عز وجل حملكم إني والله إن شاء الله تعالى لا أحلف على يمين فأرى غيرها خيرا منها إلا أتيت الذي هو خير وكفرت عن يميني أو قال إلا كفرت يميني وأتيت الذي هو خير
Its isnad is sahih. Bukhari narrated the hadith in 11/517, no. 6623, in Fath al-Bari, in the Book of Oaths, chapter on the saying of Allah Most High, "Allah does not hold you accountable for thoughtless speech in your oaths", and Muslim in 3/1268, no. 1649, and Nasai in 7/9, and Bayhaqi in 10/26.