Skip to content

Commit ddea4f8

Browse files
cursoragentmsukkari
andcommitted
fix: quote glob patterns in zoekt-git-index to prevent shell expansion
The ALWAYS_INDEX_FILE_PATTERNS environment variable accepts glob patterns like **/*.sum,**/*.lock. When these patterns are passed to zoekt-git-index via Node's exec(), the shell expands them before passing to the command, causing errors. This fix wraps the glob patterns in double quotes to prevent shell expansion, allowing the patterns to be passed literally to zoekt-git-index. Fixes SOU-247 Co-authored-by: michael <michael@sourcebot.dev>
1 parent 59ee6a5 commit ddea4f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/backend/src/zoekt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const indexGitRepository = async (repo: Repo, settings: Settings, revisio
2323
`-tenant_id ${repo.orgId}`,
2424
`-repo_id ${repo.id}`,
2525
`-shard_prefix ${shardPrefix}`,
26-
...largeFileGlobPatterns.map((pattern) => `-large_file ${pattern}`),
26+
...largeFileGlobPatterns.map((pattern) => `-large_file "${pattern}"`),
2727
repoPath
2828
].join(' ');
2929

0 commit comments

Comments
 (0)