Skip to content

Commit 77c4be3

Browse files
Don't scan into 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
1 parent d9d12ab commit 77c4be3

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
@@ -396,6 +396,10 @@ func CoreOrReferencedCoreHasChanged(corePath, targetCorePath, targetFile string)
396396

397397
func TXTBuildRulesHaveChanged(corePath, targetCorePath, targetFile string) bool {
398398

399+
// Skip any hidden directories (.git, .tmp, etc.)
400+
if strings.HasPrefix(targetfile, ".") {
401+
return nil
402+
}
399403
targetFileStat, err := os.Stat(targetFile)
400404
if err == nil {
401405
files, err := findAllFilesInFolder(corePath, true)

0 commit comments

Comments
 (0)