Skip to content

Commit

Permalink
Don't recurse into .git when collection .jl files
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Aug 28, 2024
1 parent 13b6402 commit 21808b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 21808b0

Please sign in to comment.