mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-17 09:33:02 +00:00
fix(ingestion): use glob public path type
Keep the parse-cache dependency ownership audit intact and strengthen the unlisted-directory control with a non-ignored path.
This commit is contained in:
parent
bfef50ac31
commit
38d18906cb
2 changed files with 9 additions and 4 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { logger } from '../../logger.js';
|
||||
import type { IgnoreLike } from 'glob';
|
||||
import type { Path } from 'path-scurry';
|
||||
import type { IgnoreLike, Path } from 'glob';
|
||||
|
||||
/**
|
||||
* Directory names that must never be indexed, even when listed. These hold
|
||||
|
|
|
|||
|
|
@ -663,7 +663,7 @@ int auto_main() { return 0; }`,
|
|||
it('registers headers in a dot directory only when GITNEXUS_INCLUDE_DOT_DIRS lists it', async () => {
|
||||
const previous = process.env.GITNEXUS_INCLUDE_DOT_DIRS;
|
||||
writeFile('.config/listed.h', '#pragma once');
|
||||
writeFile('.cache/unlisted.h', '#pragma once');
|
||||
writeFile('.unlisted-source/unlisted.h', '#pragma once');
|
||||
try {
|
||||
delete process.env.GITNEXUS_INCLUDE_DOT_DIRS;
|
||||
const before = await extractor.extract(null, tmpDir, makeRepo(tmpDir));
|
||||
|
|
@ -674,7 +674,13 @@ int auto_main() { return 0; }`,
|
|||
const providerIds = contracts.filter((c) => c.role === 'provider').map((p) => p.contractId);
|
||||
|
||||
expect(providerIds).toContain('include::.config/listed.h');
|
||||
expect(providerIds).not.toContain('include::.cache/unlisted.h');
|
||||
expect(providerIds).not.toContain('include::.unlisted-source/unlisted.h');
|
||||
|
||||
process.env.GITNEXUS_INCLUDE_DOT_DIRS = '.config,.unlisted-source';
|
||||
const both = await extractor.extract(null, tmpDir, makeRepo(tmpDir));
|
||||
expect(both.filter((c) => c.role === 'provider').map((p) => p.contractId)).toContain(
|
||||
'include::.unlisted-source/unlisted.h',
|
||||
);
|
||||
} finally {
|
||||
if (previous === undefined) delete process.env.GITNEXUS_INCLUDE_DOT_DIRS;
|
||||
else process.env.GITNEXUS_INCLUDE_DOT_DIRS = previous;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue