(110) باب الْبَيْعَةِ فِي الْحَرْبِ أَنْ لاَ يَفِرُّوا
Narrated `Abdullah bin Zaid:
that in the time (of the battle) of Al-Harra a person came to him and said, "Ibn Hanzala is taking the pledge of allegiance from the people for death." He said, "I will never give a pledge of allegiance for such a thing to anyone after Allah's Messenger (ﷺ)."
Reference: Sahih al-Bukhari 2959
In-book reference: Book 56, Hadith 170
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 4, Book 52, Hadith 206