Sahih Muslim #1856 b
The Book on Government 33:105
It has been narrated (through a different chain of transmitters) on the authority of Jabir who said:
While swearing fealty to the Prophet (ﷺ) we did not take the oath to death but that we would not run away (from the battlefield).