* Whether any tracked file lives under the project-relative POSIX directory * `dir`. A range scan on the `path` primary key — `dir/` up to `dir0` ('0' * is the byte after '/') — so it costs one index probe at any repo size.
(dir: string)
| 4263 | * is the byte after '/') — so it costs one index probe at any repo size. |
| 4264 | */ |
| 4265 | hasFilesUnder(dir: string): boolean { |
| 4266 | if (!this.stmts.hasFilesUnder) { |
| 4267 | this.stmts.hasFilesUnder = this.db.prepare('SELECT 1 FROM files WHERE path >= ? AND path < ? LIMIT 1'); |
| 4268 | } |
| 4269 | return this.stmts.hasFilesUnder.get(`${dir}/`, `${dir}0`) !== undefined; |
| 4270 | } |
| 4271 | |
| 4272 | /** |
| 4273 | * Get all tracked files |
no test coverage detected