hooks: invalidate the repo after the hooks
Since the hooks may have changed the repository content it seems safer to
invalidate it. The invalidation is "soft", the data are kept around and few
work will be needed to restore them if nothing actually changed.