Nafi reported,

Ubaydullah bin Abdullah and Salim bin Abdullah reported that they both spoke to Abdullah bin Umar.In another chain, Musa bin Ismail narrated to us, Juwayriya narrated to us from Nafi that one of Abdullah's sons said to him, "If only you stayed home this year, for I fear you will not be able to reach the House."He replied, "We set out with the Prophet ﷺ, and the disbelievers of Quraysh blocked us from reaching the House. So the Prophet ﷺ slaughtered his sacrificial animals, and his companions shaved or shortened their hair. He then said, 'I call you to witness that I have made umrah obligatory upon myself. If the way to the House is opened, I will perform tawaf. But if I am prevented from reaching the House, I will do as the Messenger of Allah ﷺ did.'He traveled for a while, then said, 'I see that the two matters are but one. I call you to witness that I have made hajj obligatory upon myself along with my umrah.'He then performed a single tawaf and a single sai, exiting the state of ihram from both at the same time."

Bukhari 4185

Sahih

حدثنا عبد الله بن محمد بن أسماء حدثنا جويرية

عن نافع

أن عبيد الله بن عبد الله وسالم بن عبد الله أخبراه أنهما كلما عبد الله بن عمر ح و حدثنا موسى بن إسماعيل حدثنا جويرية عن نافع أن بعض بني عبد الله قال له لو أقمت العام فإني أخاف أن لا تصل إلى البيت قال خرجنا مع النبي ﷺ فحال كفار قريش دون البيت فنحر النبي ﷺ هداياه وحلق وقصر أصحابه وقال أشهدكم أني أوجبت عمرة فإن خلي بيني وبين البيت طفت وإن حيل بيني وبين البيت صنعت كما صنع رسول الله ﷺ فسار ساعة ثم قال ما أرى شأنهما إلا واحدا أشهدكم أني قد أوجبت حجة مع عمرتي فطاف طوافا واحدا وسعيا واحدا حتى حل منهما جميعا

البخاري 4185صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Expedition of Hudaybiya
Numbering
Darussalam 4185
Bukhari 4185