Before this change we were too aggressive in deleting duplicate resources since directories might not have identical contents, and yet they were being deleted anyway. Fixes gh-614