Projects::RefsController#logs_tree performs N + 1 Gitaly RPCs

This was identified as a Gitaly IO hotspot as part of investigations in &1190 (closed)

Further details

Although we can mitigate bad Gitaly IO patterns with caching in various layers in the application, we should work to reduce these access patterns.

Proposal

Improve implementation to avoid an N+1

Edited by James Ramsay (ex-GitLab)