search: clean up parseDescriptionPattern
Created by: tbliu98
Resolving lingering issues from https://github.com/sourcegraph/sourcegraph/pull/39117
-
We want to be able to represent searching for repos with empty descriptions. Previously that was not possible because when
exact
contained an empty string""
as its sole element, we would appendTRUE
to the query condition and move on, sorepo:has.description(^$)
would match all descriptions instead of just empty ones. -
We should treat
exact != nil
andlen(exact) != 0
as the same condition.
Test plan
Manually verify in traces that the arguments passed to the database query are correct.