grepmax 0.7.14 → 0.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/index/syncer.js
CHANGED
|
@@ -58,7 +58,7 @@ const logger_1 = require("../utils/logger");
|
|
|
58
58
|
const meta_cache_1 = require("../store/meta-cache");
|
|
59
59
|
const vector_db_1 = require("../store/vector-db");
|
|
60
60
|
const filter_builder_1 = require("../utils/filter-builder");
|
|
61
|
-
|
|
61
|
+
// isIndexableFile no longer used — extension check inlined for performance
|
|
62
62
|
const lock_1 = require("../utils/lock");
|
|
63
63
|
const project_registry_1 = require("../utils/project-registry");
|
|
64
64
|
const project_root_1 = require("../utils/project-root");
|
|
@@ -329,19 +329,13 @@ function initialSync(options) {
|
|
|
329
329
|
break;
|
|
330
330
|
}
|
|
331
331
|
const absPath = path.join(paths.root, relPath);
|
|
332
|
-
//
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
visitedRealPaths.add(realPath);
|
|
338
|
-
}
|
|
339
|
-
catch (_g) {
|
|
340
|
-
// Skip broken symlinks or inaccessible files
|
|
332
|
+
// Extension check only — no stat syscall
|
|
333
|
+
const ext = path.extname(absPath).toLowerCase();
|
|
334
|
+
const basename = path.basename(absPath).toLowerCase();
|
|
335
|
+
if (!config_1.INDEXABLE_EXTENSIONS.has(ext) &&
|
|
336
|
+
!config_1.INDEXABLE_EXTENSIONS.has(basename)) {
|
|
341
337
|
continue;
|
|
342
338
|
}
|
|
343
|
-
if (!(0, file_utils_1.isIndexableFile)(absPath))
|
|
344
|
-
continue;
|
|
345
339
|
walkedFiles++;
|
|
346
340
|
yield schedule(() => __awaiter(this, void 0, void 0, function* () {
|
|
347
341
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
@@ -349,8 +343,20 @@ function initialSync(options) {
|
|
|
349
343
|
return;
|
|
350
344
|
}
|
|
351
345
|
try {
|
|
352
|
-
|
|
353
|
-
|
|
346
|
+
// Stat + symlink dedup (lstat to detect symlinks without resolving)
|
|
347
|
+
const stats = yield fs.promises.lstat(absPath);
|
|
348
|
+
if (stats.isSymbolicLink()) {
|
|
349
|
+
try {
|
|
350
|
+
const realPath = yield fs.promises.realpath(absPath);
|
|
351
|
+
if (visitedRealPaths.has(realPath))
|
|
352
|
+
return;
|
|
353
|
+
visitedRealPaths.add(realPath);
|
|
354
|
+
}
|
|
355
|
+
catch (_a) {
|
|
356
|
+
return; // Broken symlink
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (!stats.isFile() || stats.size === 0 || stats.size > config_1.MAX_FILE_SIZE_BYTES) {
|
|
354
360
|
return;
|
|
355
361
|
}
|
|
356
362
|
// Use absolute path as the key for MetaCache
|
package/package.json
CHANGED