Skip to content

Conversation

@daniel-lxs
Copy link
Contributor

🧪 Evaluation PR for Testing

This is an automated test PR created for evaluation purposes.


This fixes a path resolution bug in the ripgrep search results formatting.

The issue was that path.relative() was being called on paths that might already be relative, which could cause incorrect path resolution. The fix checks if the path is absolute before calling path.relative(), otherwise uses it as-is.

Changes:

Note: This PR excludes the upstream test file that relies on GitIgnoreController (which doesn't exist in this fork - we use RooIgnoreController instead). The core bug fix remains applicable.

j-east and others added 2 commits October 10, 2025 16:43
…and integrate with RooIgnoreController, Task, searchFilesTool; add tests; ripgrep formatting fix

if (relativeDir) {
// For nested .gitignore files, we need to create patterns that match files within that directory
const lines = content.split(/\r?\n/).filter((line) => line.trim() && !line.startsWith("#"))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter !line.startsWith("#") incorrectly removes escaped literal patterns like \#foo which should match files literally named #foo. The ignore library handles escaped patterns correctly, but this pre-filter prevents them from reaching it. The test at line 308 ("should treat \# as a literal # pattern in nested .gitignore (exposes bug in line 136)") documents this exact issue.

Consider using !line.trim().startsWith("#") or checking for the escape sequence: !(line.startsWith("#") && !line.startsWith("\\#"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants