All partition fences shall be lawful fences, unless otherwise agreed upon by the adjoining owners by a writing executed in duplicate and duly acknowledge, in which case, if such fence be kept in good repair, there shall be the same liability for damages occasioned by trespass of animals owned by said adjoining owners as if such fence were a lawful fence.