MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / hasFilesUnder

Method hasFilesUnder

src/db/queries.ts:4376–4381  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

4374 * is the byte after '/') — so it costs one index probe at any repo size.
4375 */
4376 hasFilesUnder(dir: string): boolean {
4377 if (!this.stmts.hasFilesUnder) {
4378 this.stmts.hasFilesUnder = this.db.prepare('SELECT 1 FROM files WHERE path >= ? AND path < ? LIMIT 1');
4379 }
4380 return this.stmts.hasFilesUnder.get(`${dir}/`, `${dir}0`) !== undefined;
4381 }
4382
4383 /**
4384 * Get all tracked files

Callers 1

uncoveredNestedRepoMethod · 0.45

Calls 2

prepareMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected