Skip to content

Commit

Permalink
🐛 ignore .git folder for localdir
Browse files Browse the repository at this point in the history
- ignore .git folder for localdir

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
  • Loading branch information
naveensrinivasan committed Mar 12, 2024
1 parent bfc8f37 commit 3c03bdf
Showing 1 changed file with 5 additions and 1 deletion.
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 @@ func isDir(p string) (bool, error) {
if err != nil {
return false, fmt.Errorf("%w", err)
}

return fileInfo.IsDir(), nil
}

Expand All @@ -103,6 +102,11 @@ func listFiles(clientPath string) ([]string, error) {
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

0 comments on commit 3c03bdf

Please sign in to comment.