Skip to content

search: add `has` aliases for `contains` predicates

Warren Gifford requested to merge tl/add-contains-pred-aliases into main

Created by: tbliu98

Part of #39767 (closed)

  • Introduce the following aliases:
    • repo:has.file == repo:contains.file
    • repo:has.content == repo:contains.content
    • repo:has.path == repo:contains.path
    • repo:has.commit.after == repo:contains.commit.after
    • file:has.content == file.contains.content
  • Update VisitTypedPredicate() to handle aliases
  • Update FileContainsContent() to use VisitTypedPredicate() now that it handles aliases

Test plan

Add test for VisitTypedPredicate() to make sure aliases are recognized. Manually test that has aliases return the same results as contains

Merge request reports

Loading