The evolution of a sheared potential magnetic field in the solar corona