Skip to content

fix: allow searchPath to target files and directories#196

Open
bmdavis419 wants to merge 1 commit intocodex/pr-f-cli-compat-aliasfrom
codex/pr-c-searchpath-files-and-dirs
Open

fix: allow searchPath to target files and directories#196
bmdavis419 wants to merge 1 commit intocodex/pr-f-cli-compat-aliasfrom
codex/pr-c-searchpath-files-and-dirs

Conversation

@bmdavis419
Copy link
Collaborator

@bmdavis419 bmdavis419 commented Feb 28, 2026

Summary

  • allow file targets in git resource searchPath validation/runtime checks
  • update user-facing validation hints
  • add test coverage for file-based targets

Issues

Greptile Summary

Extended git resource searchPath validation to support both files and directories, fixing issue #189.

Key Changes:

  • Replaced directoryExists with new pathExists helper to validate both file and directory targets
  • Updated error hints in getSearchPathHint to mention files as valid targets (e.g., 'src/docs' or 'README.md')
  • Added integration test coverage for file-based searchPath using README.md as test case
  • Improved git error messages for better user guidance

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is backward compatible (directories still work), adds test coverage for the new file support, and aligns with git sparse-checkout's native support for both files and directories
  • No files require special attention

Important Files Changed

Filename Overview
apps/server/src/resources/impls/git.ts Added pathExists helper and updated validation to support both files and directories in searchPath
apps/server/src/resources/impls/git.test.ts Added integration test to verify file-based searchPath support with README.md

Last reviewed commit: c1f0a52

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.

1 participant