Skip to content

Commit

Permalink
🐛 ignore .git folder for localdir (#3943)
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 13, 2024
1 parent bfc8f37 commit 1bd4af7
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
}
return nil
}

Expand Down

0 comments on commit 1bd4af7

Please sign in to comment.