Fix issue #9: symbolic link error #14
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes #9.
The issue has been successfully resolved by adding code to skip symbolic links during repository processing. The key change was in the
processRepository
function inprompt/prompt.go
, where a check was added to detect and skip symbolic links:This change specifically addresses the reported issue where Laravel's symbolic link from
/storage
topublic/storage
was causing git2gpt to fail with the error "read Codes/public/storage: is a directory". By detecting and skipping symbolic links, the tool will no longer attempt to traverse these links, preventing the error.The PR also includes a test case (
TestSymlinkHandling
incmd/symlink_test.go
) that verifies the fix works correctly by ensuring that:The test setup includes a sample directory structure that mimics the Laravel project structure that was causing the issue, with test files to validate the behavior.
Automatic fix generated by OpenHands 🙌