fix git parsing and init

- run `ls ROOT_PATH` on init to make sure we are in the right place
- match git path with `.*` to make sure we check when in a subdir
> it could cause issues though, fix this later with a better
> git interface
This commit is contained in:
kyazdani42
2020-02-19 23:01:52 +01:00
parent e85dc5eb0f
commit f397e1050c
3 changed files with 6 additions and 9 deletions

View File

@@ -35,7 +35,8 @@ end
local function create_git_checker(pattern)
return function(relpath)
for _, status in pairs(GIT_STATUS) do
local ret = string.match(status, '^.. ' .. relpath)
-- TODO: fix .* as it could be problematic
local ret = string.match(status, '^.. .*' .. relpath)
if ret ~= nil and string.match(ret, pattern) ~= nil then return true end
end
return false