It's not that hard for early middle ages. After all, Irish monks fought themselves because of loyalties divided along secular nobility, and some bishops or religious if not fighting were present in battlefield (as Odon of Bayeux or Oppa of Sevilla by exemple).
So, without talking of a lasting feature, it could happen, even if rare.
Now, it would became less rare Paix de Dieu movment (or without the development of feudalism, but it would be really hard to butterfly it without butterflying the concept of pope as we know it) that made the clergy the guarant of peace where the feudal power was defailant (where the king, duke, count couldn't really apply peace among his own vassals).
"Armies of peace" were created, composed by peasants and morally led by clergy. Some little changes could lead to a clergy in arms as a more current feature, and as many popes of the period came from the aera of devellopment of Paix de Dieu (Aquitaine, Burgundy), it's possible to have them agreeing to clergy participating in some precise conditions.
Now, having the pope fighting in battlefied is hard to have regularly, for the same reasons that no POTUS since Washington did : other responsabilities, no real strategic skills superior to others, and too dangerous to have him captured.