Skip to content

[Bug]: Nested .gitignore files are not respected #2761

@Norbiros

Description

@Norbiros

Bug Description

When running :sync to index a codebase, .gitignore files located in subdirectories are not respected. As a result, files and directories that should be excluded based on nested .gitignore rules are still processed.

Steps to Reproduce

  1. Create a project with the following structure:
project/
    frontend/
        node_modules/
        .gitignore
    .gitignore
  1. Add the following content to the root .gitignore:
.idea
*.iml
out
gen
  1. Add the following content to frontend/.gitignore:
node_modules/
.nuxt
  1. Populate the frontend/node_modules directory (fe. npm install <lib>)
  2. Run the :sync command to index the project.

Expected Behavior

The frontend/node_modules/ directory should be excluded from processing.

Actual Behavior

A pretty simple project required syncing over 316 883 files (it included logs, node_modules etc).

Error Logs

Forge Version

2.3.2

Operating System

None

OS Version

No response

AI Provider

None

Model

No response

Installation Method

npx forgecode@latest

Configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions