Skip to content

Commit

Permalink
Fixes bug where .git/* is indexed when .gitignore does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Odie committed Aug 4, 2024
1 parent d8a1651 commit dbc7df8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/gp/context.lua
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,15 @@ end
local function make_gitignore_fn(git_root)
local base_paths = { git_root }
local allow = require("plenary.scandir").__make_gitignore(base_paths)
if not allow then
return nil
end

return function(entry, rel_path, full_path, is_dir)
if entry == ".git" or entry == ".github" then
return false
end
return allow(base_paths, full_path)
if allow then
return allow(base_paths, full_path)
end
return true
end
end

Expand Down

0 comments on commit dbc7df8

Please sign in to comment.