Skip to content

Commit 2eed815

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 2eed815

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
@@ -398,6 +398,10 @@ func TXTBuildRulesHaveChanged(corePath, targetCorePath, targetFile string) bool
398398

399399
targetFileStat, err := os.Stat(targetFile)
400400
if err == nil {
401+
// Skip any hidden directories (.git, .tmp, etc.)
402+
if targetFileStat.IsDir() && strings.HasPrefix(targetfile, ".") {
403+
return nil
404+
}
401405
files, err := findAllFilesInFolder(corePath, true)
402406
if err != nil {
403407
return true

0 commit comments

Comments
 (0)