git.lua (319B)
1 local M = {} 2 3 M.is_git = function(path) 4 ---@diagnostic disable-next-line: unused-local 5 local id = vim.fn.jobstart('git -C "' .. path .. '" rev-parse', {on_exit = function(_, code, type) end}) 6 local status = vim.fn.jobwait({id})[1] 7 if status == 0 then 8 return true 9 else 10 return false 11 end 12 end 13 14 return M