Skip to content

Commit 337de5f

Browse files
authored
Allow using count:all in repo query (#566)
1 parent 2fe9661 commit 337de5f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ All notable changes to `src-cli` are documented in this file.
1717

1818
### Fixed
1919

20+
- `count:all` was not supported in repository search queries for batch changes. This is now fixed. [#566](https://github.com/sourcegraph/src-cli/pull/566)
21+
2022
### Removed
2123

2224
## 3.29.2

internal/batches/service/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ func (svc *Service) FindDirectoriesInRepos(ctx context.Context, fileName string,
651651
return results, nil
652652
}
653653

654-
var defaultQueryCountRegex = regexp.MustCompile(`\bcount:\d+\b`)
654+
var defaultQueryCountRegex = regexp.MustCompile(`\bcount:(\d+|all)\b`)
655655

656656
const hardCodedCount = " count:999999"
657657

internal/batches/service/service_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func TestSetDefaultQueryCount(t *testing.T) {
1919
for in, want := range map[string]string{
2020
"": hardCodedCount,
2121
"count:10": "count:10",
22+
"count:all": "count:all",
2223
"r:foo": "r:foo" + hardCodedCount,
2324
"r:foo count:10": "r:foo count:10",
2425
"r:foo count:10 f:bar": "r:foo count:10 f:bar",

0 commit comments

Comments
 (0)