Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 ignore .git folder for localdir #3943

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion clients/localdir/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
if err != nil {
return false, fmt.Errorf("%w", err)
}

return fileInfo.IsDir(), nil
}

Expand All @@ -103,6 +102,11 @@
return err
}
if d {
// Check if the directory is .git. Use filepath.Base for compatibility across different OS path separators.
// ignoring the .git folder.
if filepath.Base(pathfn) == ".git" {
return fs.SkipDir
}

Check warning on line 109 in clients/localdir/client.go

View check run for this annotation

Codecov / codecov/patch

clients/localdir/client.go#L108-L109

Added lines #L108 - L109 were not covered by tests
return nil
}

Expand Down
Loading