Narrated 'Ikrimah: The Prophet ﷺ as saying: I swear by Allah, I shall fight against the Quraish. The then said: If Allah wills. He again said: I swear by Allah, I shall fight against the Quraish if Allah wills. He again said: I swear by Allah, I shall fight against the Quraish. He then kept silence. Then he said: If Allah wills. Abu Dawud said: Al-Walid b. Muslim said on the authority of Sharik: He then said: But he did not fight against them.
This hadith also reminds us of the importance of being careful with our words and promises; when making an oath or a promise, we must be sure that we are able to fulfill it before saying anything out loud. We should also remember that if something is out of our control or beyond our capabilities, then there is no point in swearing by Allah about it as He knows best what will happen in any given situation.