Make sure that the repository isn't being written to when discovering that the head has changed.