We present evidence from an indefinitely repeated gift-exchange game where market structures affect proposers’ ability to punish uncooperative partners and their ability to sort between cooperative and uncooperative partners. Treatments vary by whether subjects can replace their partners, and if not, whether they can reduce their gift from one round to the next. Comparing treatments without contract restrictions, our replacement treatment is no different initially but has higher cooperation in the long run. Comparing treatments without replacement, our treatment with contract restrictions has lower cooperation initially but is no different in the long run. Neither of these findings are predicted by theories of repeated games based on the ability to punish, however, both findings are consistent with a simple sorting model.