Skip to content

Never skip .git when copying repo to temp#68

Merged
andy1li merged 3 commits intomainfrom
andy/tweak-gitignore
Feb 20, 2026
Merged

Never skip .git when copying repo to temp#68
andy1li merged 3 commits intomainfrom
andy/tweak-gitignore

Conversation

@andy1li
Copy link
Member

@andy1li andy1li commented Jan 14, 2026

Issue:

When users have .git in their gitignore files, it breaks the CLI.


Note

Low Risk
Small, targeted guard in path-filtering logic with added tests; risk is limited to edge cases in path matching and may slightly reduce ignore behavior for unconventional .git-named paths.

Overview
Prevents the CLI from accidentally excluding repository metadata when users ignore .git.

GitIgnore.SkipFile now explicitly returns not skipped for the .git directory and anything under it before checking local/global ignore rules (including .git/info/exclude). Tests add coverage ensuring .git and common nested/absolute .git paths are never skipped even if .gitignore contains patterns like .git or .git/*.

Written by Cursor Bugbot for commit c779ecc. This will update automatically on new commits. Configure here.

… skipped. This change improves the handling of ignored files by explicitly allowing the .git directory, even if specified in .gitignore files.
@andy1li andy1li self-assigned this Jan 14, 2026
@andy1li andy1li requested a review from rohitpaulk January 14, 2026 01:22
…s contents. This update ensures that any files within the .git directory are treated correctly, improving the handling of ignored files in version control.
Copy link
Member

@rohitpaulk rohitpaulk left a comment

Choose a reason for hiding this comment

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

@andy1li let's add tests for this

…tents are not skipped. Added new test cases to ensure proper handling of paths related to the .git directory, reinforcing the logic implemented in the GitIgnore functionality.
@andy1li andy1li merged commit 8228104 into main Feb 20, 2026
4 checks passed
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.

2 participants