mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: use relative paths in isPathInIgnoredDirectory to fix worktree indexing (#11009)
This commit is contained in:
parent
d6d00dedec
commit
b9cf163b87
2 changed files with 7 additions and 3 deletions
|
|
@ -508,8 +508,12 @@ export class FileWatcher implements IFileWatcher {
|
|||
*/
|
||||
async processFile(filePath: string): Promise<FileProcessingResult> {
|
||||
try {
|
||||
// Get relative path for ignore checks
|
||||
const relativeFilePath = generateRelativeFilePath(filePath, this.workspacePath)
|
||||
|
||||
// Check if file is in an ignored directory
|
||||
if (isPathInIgnoredDirectory(filePath)) {
|
||||
// Use relative path to avoid matching parent directories outside the workspace
|
||||
if (isPathInIgnoredDirectory(relativeFilePath)) {
|
||||
return {
|
||||
path: filePath,
|
||||
status: "skipped" as const,
|
||||
|
|
@ -518,7 +522,6 @@ export class FileWatcher implements IFileWatcher {
|
|||
}
|
||||
|
||||
// Check if file should be ignored
|
||||
const relativeFilePath = generateRelativeFilePath(filePath, this.workspacePath)
|
||||
if (
|
||||
!this.ignoreController.validateAccess(filePath) ||
|
||||
(this.ignoreInstance && this.ignoreInstance.ignores(relativeFilePath))
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ export class DirectoryScanner implements IDirectoryScanner {
|
|||
const relativeFilePath = generateRelativeFilePath(filePath, scanWorkspace)
|
||||
|
||||
// Check if file is in an ignored directory using the shared helper
|
||||
if (isPathInIgnoredDirectory(filePath)) {
|
||||
// Use relative path to avoid matching parent directories outside the workspace
|
||||
if (isPathInIgnoredDirectory(relativeFilePath)) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue