The Prophet ﷺ and his companions entered the state of ihram in the year of Hudaybiyyah, except for Uthman and Abu Qatada. He prayed for forgiveness for those who shaved their heads three times, and for those who shortened their hair once.
حدثنا يزيد أخبرنا هشام عن يحيى عن أبي إبراهيم
أن النبي ﷺ أحرم وأصحابه عام الحديبية غير عثمان وأبي قتادة فاستغفر للمحلقين ثلاثا وللمقصرين مرة
Its isnad is sahih. Yazid is Ibn Harun, Hisham is Ibn Hassan, and Yahya is Ibn Saeed. As for "Abu Ibrahim," the correct form is "Ibrahim," and he is Nakhai bin Yazid. All of them are trustworthy. It is found in Muslim with similar wording in the Hajj chapter, 2/946, no. 1302, chapter on the superiority of shaving over trimming, and in Abu Dawud, 2/202, no. 1979, and Tirmidhi, 3/247, no. 913, where he said, hasan sahih.