findGitignoreFiles() — mcp Function Reference
Architecture documentation for the findGitignoreFiles() function in zip-repository.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD dde30444_a7df_fa00_0129_12e7f409e2e4["findGitignoreFiles()"] 44adfa8b_2ebc_f147_11ab_97c37a623907["buildIgnoreFilter()"] 44adfa8b_2ebc_f147_11ab_97c37a623907 -->|calls| dde30444_a7df_fa00_0129_12e7f409e2e4 dfe11f52_4dd3_db89_9717_941d05bae091["warn()"] dde30444_a7df_fa00_0129_12e7f409e2e4 -->|calls| dfe11f52_4dd3_db89_9717_941d05bae091 style dde30444_a7df_fa00_0129_12e7f409e2e4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/utils/zip-repository.ts lines 520–573
async function findGitignoreFiles(rootDir: string): Promise<string[]> {
const gitignoreFiles: string[] = [];
async function searchDirectory(dir: string): Promise<void> {
let entries: string[];
try {
entries = await fs.readdir(dir);
} catch (error: any) {
if (error.code === 'EACCES') {
logger.warn('Permission denied:', dir);
return;
}
return;
}
for (const entry of entries) {
// Skip .git directory and other version control directories
if (entry === '.git' || entry === '.svn' || entry === '.hg') {
continue;
}
const fullPath = join(dir, entry);
// If this is a .gitignore file, add it to the list
if (entry === '.gitignore') {
gitignoreFiles.push(fullPath);
continue;
}
// If it's a directory, recurse into it
try {
const stats = await fs.lstat(fullPath);
if (stats.isDirectory() && !stats.isSymbolicLink()) {
await searchDirectory(fullPath);
}
} catch (error: any) {
// Skip files we can't access
continue;
}
}
}
await searchDirectory(rootDir);
// Sort so root .gitignore is processed first
gitignoreFiles.sort((a, b) => {
const aDepth = a.split(sep).length;
const bDepth = b.split(sep).length;
return aDepth - bDepth;
});
return gitignoreFiles;
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does findGitignoreFiles() do?
findGitignoreFiles() is a function in the mcp codebase.
What does findGitignoreFiles() call?
findGitignoreFiles() calls 1 function(s): warn.
What calls findGitignoreFiles()?
findGitignoreFiles() is called by 1 function(s): buildIgnoreFilter.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free