···69697070 // Branch name => ID
7171 branches map[string]int
7272+7373+ // The repository name
7474+ repoName string
7275}
73767477// ContentSize returns the number of content bytes so far ingested.
···8588 namePostings: make(map[ngram][]uint32),
8689 branches: make(map[string]int),
8790 }
9191+}
9292+9393+func (b *IndexBuilder) SetName(nm string) {
9494+ b.repoName = nm
8895}
89969097// AddFile adds a file. This is the basic ordering for search results,
+13
parse.go
···138138 return string(arg), n, ok, err
139139}
140140141141+func tryConsumeRepo(in []byte) (string, int, bool, error) {
142142+ arg, n, ok, err := consumeKeyword(in, []byte("repo:"))
143143+ return string(arg), n, ok, err
144144+}
145145+141146func Parse(qStr string) (Query, error) {
142147 b := []byte(qStr)
143148···178183 Pattern: fn,
179184 FileName: true,
180185 })
186186+ b = b[n:]
187187+ continue
188188+ }
189189+190190+ if fn, n, ok, err := tryConsumeRepo(b); err != nil {
191191+ return nil, err
192192+ } else if ok {
193193+ add(&RepoQuery{Name: fn})
181194 b = b[n:]
182195 continue
183196 }