Skip to content

Commit

Permalink
query: Empty branch is the constant TRUE
Browse files Browse the repository at this point in the history
0a9e7c0 evaluated both the empty branch and
empty repo as the constant true. However, empty repo was treated as an indicator
to display the list of all repos, so broke that functionality. However, there is
no such special casing for branch.

Change-Id: I15bc8617486211cecabcbf4d26a602b017f80fe0
  • Loading branch information
keegancsmith committed Jan 22, 2018
1 parent 016570d commit 9a7e12f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ func evalConstants(q Q) Q {
if s.Regexp.Op == syntax.OpEmptyMatch {
return &Const{true}
}
case *Branch:
if s.Pattern == "" {
return &Const{true}
}
}
return q
}
Expand Down

0 comments on commit 9a7e12f

Please sign in to comment.