Files
orca/src/main/git/source-control/gitattributes-stamp-paths.ts
T
Neil d406a22214 perf(git): reuse the branch-compare changed-files list while its inputs are unchanged (#39747)
* refactor(git): share the .gitattributes ancestor stamp paths

* perf(git): reuse the branch-compare changed-files list per commit pair

* perf(git): charge cached change lists for the stdout their paths retain

* perf(git): bound branch change-list reuse to five minutes for unstamped system attributes

* refactor(git): share the deadline-bounded stamp probe

* perf(git): bound branch change-list attribute stamps by a 2s deadline and 4096 paths
2026-11-07 21:42:01 -08:00

8 lines
393 B
TypeScript

/** Add every in-tree `.gitattributes` Git consults for a repo-relative path: the root one and each ancestor's. */
export function addGitattributesStampPaths(target: Set<string>, repoPath: string): void {
target.add('.gitattributes')
for (let end = repoPath.indexOf('/'); end !== -1; end = repoPath.indexOf('/', end + 1)) {
target.add(`${repoPath.slice(0, end)}/.gitattributes`)
}
}