Expire related caches after changing HEAD

Rémy Coutable requested to merge pmq20/gitlab-ce-psvr/head/cache into master

Originally opened at !3919 (closed) by @pmq20.

What does this MR do?

Ensures that, for example, the README of the project is updated when its HEAD changed via the settings page.

Are there points in the code the reviewer needs to double check?

Check if I missed other similar scenarios where similar problems exist.

Why was this MR needed?

Because all cache involving HEAD should be updated when HEAD changes.

Does this MR meet the acceptance criteria?

Merge request reports