(110) باب الْبَيْعَةِ فِي الْحَرْبِ أَنْ لاَ يَفِرُّوا
Narrated Ibn `Umar:
When we reached (Hudaibiya) in the next year (of the treaty of Hudaibiya), not even two men amongst us agreed unanimously as to which was the tree under which we had given the pledge of allegiance, and that was out of Allah's Mercy. (The sub narrator asked Naf'i, "For what did the Prophet (ﷺ) take their pledge of allegiance, was it for death?" Naf'i replied "No, but he took their pledge of allegiance for patience.")
Reference: Sahih al-Bukhari 2958
In-book reference: Book 56, Hadith 169
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 4, Book 52, Hadith 205