Sahih Muslim 1860
Sahih Muslim · Book 33: The Book on Government · It is recommended for the army to swear allegiance to the ruler when intending to fight, and an account of Bay'at Ar-Ridwan beneath the tree
وَحَدَّثَنَاهُ إِسْحَاقُ بْنُ إِبْرَاهِيمَ ، حَدَّثَنَا حَمَّادُ بْنُ مَسْعَدَةَ ، حَدَّثَنَا يَزِيدُ ، عَنْ سَلَمَةَ ، بِمِثْلِهِ .
The above tradition has also been handed down through a different chain of transmitters.