fix bug where it did not check the cwd for the .git folder

This commit is contained in:
2026-06-14 22:01:22 +02:00
parent 509994ac55
commit c7b7cf08e0
+2
View File
@@ -363,12 +363,14 @@ do
local function look_for_file(glob_pattern) local function look_for_file(glob_pattern)
---@type string[] ---@type string[]
local folders = {vim.fn.getcwd()} local folders = {vim.fn.getcwd()}
if not file_exists(folders[1], '.git') then
for dir in vim.fs.parents(vim.fn.getcwd()) do for dir in vim.fs.parents(vim.fn.getcwd()) do
table.insert(folders, dir) table.insert(folders, dir)
if file_exists(dir, '.git') then if file_exists(dir, '.git') then
break break
end end
end end
end
for _, dir in ipairs(folders) do for _, dir in ipairs(folders) do
if file_exists(dir, glob_pattern) then if file_exists(dir, glob_pattern) then