• Yorick Peterse's avatar
    Cache project avatars stored in Git · 3e38fbd7665d
    Yorick Peterse authored
    The avatar logic has been moved from Project to Repository as this makes
    caching easier. The logic itself in turn has been changed so that the
    logo file names are cached in Redis. This cache is flushed upon pushing
    a commit but _only_ if:
    1. The commit was pushed to the default branch
    2. The commit actually changes any of the logo files
    If no branch or commit is given the cache is flushed anyway, this
    ensures that calling Repository#expire_cache without any arguments still
    flushes the avatar cache (e.g. this is used when removing a project).
    Fixes gitlab-org/gitlab-ce#14363