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

Function gitlinkEmbeddedRepoSkipped

src/extraction/index.ts:728–739  ·  view source on GitHub ↗

* Whether an embedded repo found as a tracked gitlink (mode 160000, #1031/#1033) * must be SKIPPED rather than indexed. A gitlink is tracked, so `.gitignore` * can't untrack it — but the discovery passes for it must still honor the same * scope rules as every other path, or a gitignored reference

(
  relDir: string,
  prefix: string,
  defaults: Ignore,
  repoIgnore: Ignore,
  includeIgnored: Ignore | null,
)

Source from the content-addressed store, hash-verified

726 * both passed in so they're built once per repo level rather than per gitlink.
727 */
728function gitlinkEmbeddedRepoSkipped(
729 relDir: string,
730 prefix: string,
731 defaults: Ignore,
732 repoIgnore: Ignore,
733 includeIgnored: Ignore | null,
734): boolean {
735 if (defaults.ignores(relDir)) return true; // default-ignored — never index, opt-in can't revive
736 if (!repoIgnore.ignores(relDir)) return false; // not ignored at all — index as before (#1031/#1033)
737 // Gitignored by the repo's own rules — skip unless the project opted it in.
738 return !includeIgnored?.ignores(normalizePath(prefix + relDir));
739}
740
741/**
742 * Standalone discovery of every embedded repo root under `rootDir` (relative,

Callers 2

visitFunction · 0.85
collectGitFilesFunction · 0.85

Calls 2

normalizePathFunction · 0.90
ignoresMethod · 0.80

Tested by

no test coverage detected