From 21808b0a56cb40372ab85ea6e3371378a6915c04 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Wed, 28 Aug 2024 11:44:51 +0200 Subject: [PATCH] Don't recurse into .git when collection .jl files --- src/main.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.jl b/src/main.jl index f5a1971..f3a1df3 100644 --- a/src/main.jl +++ b/src/main.jl @@ -78,6 +78,12 @@ function maybe_expand_directory!(outfiles, dir) return end for (root, _, files) in walkdir(dir; onerror = (err) -> nothing) + # Don't recurse into `.git`. If e.g. a branch name ends with `.jl` there are files + # inside of `.git` which has the `.jl` extension, but they are not Julia source + # files. + if occursin(".git", root) && ".git" in splitpath(root) + continue + end for file in files if endswith(file, ".jl") push!(outfiles, joinpath(root, file))