Reduce number of zoekt RPCs for repohasfile: queries
Created by: ijt
Fixes #4833, reducing latency for queries with repohasfile:
.
Before this change, the frontend was making one RPC to zoekt per repo to check if it had a file matching the repohasfile:
pattern. After this change, the frontend makes a single RPC to find all the repos with files matching the pattern.
Test plan: reuse existing unit tests for repoShouldBeAdded
by retrofitting.
The images here show a 7x speedup on this query running on a local instance with 60 repositories: