When Amasa delayed his task, David appointed Abishai and Joab to take the gibborim ("mighty men") and the body-guard and such troops as he could gather, and pursue Sheba.
An unnamed wise woman from the city convinced Joab not to destroy Abel Beth-Maacah, because the people did not want Sheba hiding there.
In Tosefta Terumot 7:19, the rabbis debate whether it was proper under Jewish law to give up Sheba in order to save the city from Joab's army.
Rabbi Judah bar Ilai said the wise woman acted properly because Joab had the city surrounded.
[1] This story served as the source for the subsequent halachic discussion whether it is permissible for a group or community to save itself by sacrificing an individual.