Skip to content

Commit 44f482a

Browse files
Don't scan hidden directories (.git, etc)
When checking for updated core files, don't scan inside UNIX hidden directories like .git. Scanning inside a GIT tree for a large project with many branches could take many minutes of runtime and multiple GB of RAM. This was seen in the Arduino core for the ESP8266, but is probably also an issue for other core development teams. Fixes arduino#327 Signed-off-by: Earle F. Philhower, III <[email protected]>
1 parent d9d12ab commit 44f482a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: builder_utils/utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
149149
}
150150

151151
for _, folder := range folders {
152+
// Skip any hidden directories (.git, .tmp, etc.)
153+
if strings.HasPrefix(folder.Name(), ".") {
154+
continue
155+
}
152156
otherSources, err := findAllFilesInFolder(filepath.Join(sourcePath, folder.Name()), recurse)
153157
if err != nil {
154158
return nil, i18n.WrapError(err)

0 commit comments

Comments
 (0)