Make repohasfile filter work for repo results
Created by: attfarhan
Fixes https://github.com/sourcegraph/sourcegraph/issues/4584. Partially addresses https://github.com/sourcegraph/sourcegraph/issues/4608.
This makes the repohasfile
filter work for repo results. The work done previously only allowed it to work on text and file path matches.
This means that queries like
repohasfile:Dockerfile
-
type:repo repohasfile:Dockerfile
, and will return a list of relevant repositories.
This PR also removes the special errors that we returned when users executed these queries.
It also removes the special error returned for queries like repohasfile:foo type:path
. I realized type:path
itself needs another search term. Therefore, before actually supporting the query repohasfile:foo type:path
, we'd need to support type:path
as a query first. So, if users already understand this (we haven't received any complaints about this afaik), it's probably OK to just show no results. I would also rather not link to an issue, since we don't actually have it on the roadmap to add this functionality. (cc @slimsag this is one of the error cases we added before the release was cut)
Test plan: added unit tests