From dbc7df8721a92dd3ffcb40bd3f0b8a1abcb530dd Mon Sep 17 00:00:00 2001 From: Jonathan Shieh Date: Sun, 4 Aug 2024 16:35:01 +0800 Subject: [PATCH] Fixes bug where .git/* is indexed when .gitignore does not exist --- lua/gp/context.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/gp/context.lua b/lua/gp/context.lua index e797eda5..f31d689c 100644 --- a/lua/gp/context.lua +++ b/lua/gp/context.lua @@ -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